Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarPlayerTech.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2024-05-29 11:31:54 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2024-05-29 11:31:54 +1000
commit465f07a9b774d147bc7a55d600bdfd1cd9a7c4d4 (patch)
tree92d1d368caaf300ea768085b65a096d1a6b01975 /source/game/StarPlayerTech.cpp
parent20882990e011f149ae77db117f52526f1cdc9f9a (diff)
fix unknown tech logging
Diffstat (limited to 'source/game/StarPlayerTech.cpp')
-rw-r--r--source/game/StarPlayerTech.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/game/StarPlayerTech.cpp b/source/game/StarPlayerTech.cpp
index 3f2db05..bf8053f 100644
--- a/source/game/StarPlayerTech.cpp
+++ b/source/game/StarPlayerTech.cpp
@@ -10,11 +10,12 @@ PlayerTech::PlayerTech(Json const& json) {
m_availableTechs = jsonToStringSet(json.get("availableTechs"));
m_enabledTechs = jsonToStringSet(json.get("enabledTechs"));
auto techDatabase = Root::singleton().techDatabase();
- for (auto p : json.get("equippedTechs", JsonObject()).iterateObject()) {
- if (techDatabase->contains(p.second.toString()))
- m_equippedTechs.set(TechTypeNames.getLeft(p.first), p.second.toString());
+ for (auto& p : json.getObject("equippedTechs")) {
+ String techName = p.second.toString();
+ if (techDatabase->contains(techName))
+ m_equippedTechs.set(TechTypeNames.getLeft(p.first), techName);
else
- Logger::warn("Missing tech '%s' in slot '%s'", p.second.toString(), p.first);
+ Logger::warn("Unequipping unknown tech '{}' from slot '{}'", techName, p.first);
}
}