fix: Dismantling basically being O(n!) (#1295)

This commit is contained in:
David Markowitz
2023-11-15 17:29:53 -08:00
committed by GitHub
parent 59303a232e
commit 8b270ca97a
3 changed files with 44 additions and 39 deletions

View File

@@ -2708,7 +2708,7 @@ void GameMessages::HandleBBBSaveRequest(RakNet::BitStream* inStream, Entity* ent
PropertyManagementComponent::Instance()->AddModel(newEntity->GetObjectID(), newIDL);
}
});
});
}
void GameMessages::HandlePropertyEntranceSync(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
@@ -5441,10 +5441,8 @@ void GameMessages::HandleRemoveItemFromInventory(RakNet::BitStream* inStream, En
iStackCount = std::min<uint32_t>(item->GetCount(), iStackCount);
if (bConfirmed) {
for (auto i = 0; i < iStackCount; ++i) {
if (eInvType == eInventoryType::MODELS) {
item->DisassembleModel();
}
if (eInvType == eInventoryType::MODELS) {
item->DisassembleModel(iStackCount);
}
item->SetCount(item->GetCount() - iStackCount, true);