mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-30 01:41:40 +00:00
fix(inventory): the charxml's items element has nn="1", as live
Live charxmls carried <items nn="1"> (225 of 226 captured). LWOInventoryComponent_Common::LoadFromSaveData reads it and then does not add the inventory component's template items to the loaded character. No effect on players today (the player LOT's inventory component has no items); the server never wrote it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -860,6 +860,9 @@ void InventoryComponent::WriteSaveData(tinyxml2::XMLDocument& document) {
|
||||
}
|
||||
|
||||
items->DeleteChildren();
|
||||
// As live wrote it (225 of 226 captured charxmls): LWOInventoryComponent_Common::LoadFromSaveData then
|
||||
// doesn't add the inventory component's template items to a loaded character
|
||||
items->SetAttribute("nn", 1);
|
||||
|
||||
// Saved while the equipped items are pushed (build mode, possibly carrying a model): the character's equipment is
|
||||
// the pushed state, which PopEquippedItems puts back, not the temporary items equipped since.
|
||||
|
||||
@@ -93,3 +93,9 @@ TEST_F(InventorySaveTests, ItemTakenOffInBuildModeIsStillSavedEquipped) {
|
||||
|
||||
EXPECT_TRUE(SavedEquipped(hat->GetId()));
|
||||
}
|
||||
|
||||
// Live charxmls have <items nn="1">
|
||||
TEST_F(InventorySaveTests, ItemsAreSavedWithNn) {
|
||||
inventory->WriteSaveData(doc);
|
||||
EXPECT_STREQ(doc.FirstChildElement("obj")->FirstChildElement("inv")->FirstChildElement("items")->Attribute("nn"), "1");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user