From 4443d98104fe0eacb7ae5537c4838cb098d4656e Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Sun, 27 Sep 2026 07:48:43 -0500 Subject: [PATCH] fix: read character flags the way they are written again Flags are only ever written by the server as numbers, so a malformed flag can't come from our own saves. Skipping one on load would drop it from the character on the next save, which is worse than the load failing. Restores the original parsing; the null checks for a missing obj tag and the refusal to save a character whose xml never loaded stay. Refs #1332 Co-Authored-By: Claude Opus 5.5 --- dGame/Character.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/dGame/Character.cpp b/dGame/Character.cpp index 8e29d381b..d4e11a9f3 100644 --- a/dGame/Character.cpp +++ b/dGame/Character.cpp @@ -225,15 +225,13 @@ void Character::DoQuickXMLDataParse() { const auto* id = currentChild->Attribute("id"); const auto* si = currentChild->Attribute("si"); if (temp && id) { - // A malformed flag in the save should skip that flag, not throw out of the whole load. - const auto index = GeneralUtils::TryParse(id); - const auto value = GeneralUtils::TryParse(temp); + uint32_t index = 0; + uint64_t value = 0; - if (index && value) { - m_PlayerFlags.insert(std::make_pair(index.value(), value.value())); - } else { - LOG("Skipping malformed flag (id %s, v %s) for character %llu", id, temp, m_ObjectID); - } + index = std::stoul(id); + value = std::stoull(temp); + + m_PlayerFlags.insert(std::make_pair(index, value)); } else if (si) { auto value = GeneralUtils::TryParse(si); if (value) m_SessionFlags.insert(value.value());