Ugc: Add subkey for rockets and cars (#1266)

Tested that, if a user has followed the guide and turned UGCUSE3DSERVICES from 1 to 0, the do not get booted to login for having a rocket with a subkey in their inventory.

Add bouncer logic

Ugc: Use random Id
This commit is contained in:
David Markowitz 2023-11-08 10:18:02 -08:00 committed by GitHub
parent 4c10faa852
commit 52b5994b98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5610,10 +5610,18 @@ void GameMessages::HandleModularBuildFinish(RakNet::BitStream* inStream, Entity*
std::vector<LDFBaseData*> config;
config.push_back(moduleAssembly);
LWOOBJID newIdBig;
// Make sure a subkey isnt already in use. Persistent Ids do not make sense here since this only needs to be unique for
// this character. Because of that, we just generate a random id and check for a collision.
do {
newIdBig = ObjectIDManager::Instance()->GenerateRandomObjectID();
GeneralUtils::SetBit(newIdBig, eObjectBits::CHARACTER);
} while (inv->FindItemBySubKey(newIdBig));
if (count == 3) {
inv->AddItem(6416, 1, eLootSourceType::QUICKBUILD, eInventoryType::MODELS, config);
inv->AddItem(6416, 1, eLootSourceType::QUICKBUILD, eInventoryType::MODELS, config, LWOOBJID_EMPTY, true, false, newIdBig);
} else if (count == 7) {
inv->AddItem(8092, 1, eLootSourceType::QUICKBUILD, eInventoryType::MODELS, config);
inv->AddItem(8092, 1, eLootSourceType::QUICKBUILD, eInventoryType::MODELS, config, LWOOBJID_EMPTY, true, false, newIdBig);
}
auto* missionComponent = character->GetComponent<MissionComponent>();