feat: store each named pet's LOT in pet_names

pet_names gets a pet_lot column (mysql 80, sqlite 63). The world writes
it whenever it saves a pet name, from the pet entity's LOT, and fills it
in for older rows when the owner loads into a world (from the pets the
game loads for that character, only where it is still missing).

The dashboard's pet name tables read pet_lot instead of scanning the
owner's character XML; pets without it yet show as Unknown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-27 03:51:39 -05:00
parent 330f02de30
commit 9682556128
14 changed files with 72 additions and 36 deletions

View File

@@ -1731,9 +1731,9 @@ void InventoryComponent::LoadPetXml(const tinyxml2::XMLDocument& document) {
auto* petElement = petInventoryElement->FirstChildElement();
while (petElement != nullptr) {
LWOOBJID id;
LOT lot;
int32_t moderationStatus;
LWOOBJID id{};
LOT lot{};
int32_t moderationStatus{};
petElement->QueryAttribute("id", &id);
petElement->QueryAttribute("l", &lot);
@@ -1747,6 +1747,9 @@ void InventoryComponent::LoadPetXml(const tinyxml2::XMLDocument& document) {
SetDatabasePet(id, databasePet);
// Pets named before pet_names recorded their LOT get it now that their owner is loaded
if (id != LWOOBJID_EMPTY && lot > 0) Database::Get()->SetPetLotIfMissing(id, lot);
petElement = petElement->NextSiblingElement();
}
}