summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFedja Beader <fedja@protonmail.ch>2025-03-01 00:29:51 +0000
committerFedja Beader <fedja@protonmail.ch>2025-03-01 00:29:51 +0000
commit0a9dd8b9971ac39f451bb0543c93b4308de29c36 (patch)
tree38372e0e2a09523929a6e43d46c2bb2433d9a8b9
parentcfbf2d1618f273e766f576f33099d4ecb1e27610 (diff)
downloadmanaplus-0a9dd8b9971ac39f451bb0543c93b4308de29c36.tar.gz
manaplus-0a9dd8b9971ac39f451bb0543c93b4308de29c36.tar.bz2
manaplus-0a9dd8b9971ac39f451bb0543c93b4308de29c36.tar.xz
manaplus-0a9dd8b9971ac39f451bb0543c93b4308de29c36.zip
Report missing/unknown attr fields in clientdata stats.xml
This makes sure that ml/clientdata!180 never happens again via message in Debug tab. The legacy numeric ID method could be deprecated. Maybe after release. The client uses full attribute names since 2016. **** mana/plus!137
-rw-r--r--src/resources/db/statdb.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/resources/db/statdb.cpp b/src/resources/db/statdb.cpp
index 36c26f1e3..adedb1102 100644
--- a/src/resources/db/statdb.cpp
+++ b/src/resources/db/statdb.cpp
@@ -121,11 +121,15 @@ static void loadStats(XmlNodeConstPtr rootNode,
reportAlways("Wrong attr or id for %s stat with name %s",
(isBasic ? "basic" : "extended"),
name.c_str())
- continue;
}
-
- stats.push_back(BasicStat(static_cast<AttributesT>(id),
- tag, name));
+ else
+ {
+ reportAlways("StatDb: stat name '%s' has empty attr field"
+ ", using legacy method (id).",
+ name.c_str());
+ stats.push_back(BasicStat(static_cast<AttributesT>(id),
+ tag, name));
+ }
}
else
{