mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-25 06:57:28 +00:00
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:
parent
4c10faa852
commit
52b5994b98
@ -5610,10 +5610,18 @@ void GameMessages::HandleModularBuildFinish(RakNet::BitStream* inStream, Entity*
|
|||||||
std::vector<LDFBaseData*> config;
|
std::vector<LDFBaseData*> config;
|
||||||
config.push_back(moduleAssembly);
|
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) {
|
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) {
|
} 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>();
|
auto* missionComponent = character->GetComponent<MissionComponent>();
|
||||||
|
Loading…
Reference in New Issue
Block a user