Compare commits

...

7 Commits

Author SHA1 Message Date
David Markowitz
2df125e087 Merge branch 'main' into object-debugger-stuff 2025-10-04 16:23:26 -07:00
David Markowitz
d58919dcfb fix: changed item ids not reflected in equipped items 2025-10-04 16:23:15 -07:00
David Markowitz
e756ce4ec4 banana 2025-10-03 22:58:13 -07:00
David Markowitz
80f909abb9 Merge branch 'main' into object-debugger-stuff 2025-10-03 22:55:17 -07:00
David Markowitz
7da061aecf fix: live accurate player flag missions and flag debugging
Tested that the client reflects the correct server progression after a test map and manually setting a flag off.
tested that session flags correctly pick up on progression updates
2025-10-03 22:55:05 -07:00
David Markowitz
c66e86caa2 Merge branch 'main' into object-debugger-stuff 2025-10-02 01:33:43 -07:00
David Markowitz
dbb6e3e0b8 feat: Add component ID to root component object 2025-10-02 01:32:50 -07:00

View File

@@ -324,10 +324,13 @@ Inventory::~Inventory() {
void Inventory::RegenerateItemIDs() {
std::map<LWOOBJID, Item*> newItems{};
for (auto* const item : items | std::views::values) {
const bool equipped = item->GetParent() == LWOOBJID_EMPTY && item->IsEquipped();
if (equipped) item->UnEquip();
const auto oldID = item->GetId();
const auto newID = item->GenerateID();
LOG("Updating item ID from %llu to %llu", oldID, newID);
newItems.insert_or_assign(newID, item);
if (equipped) item->Equip();
}
// We don't want to delete the item pointers, we're just moving from map to map