fix unknown tech logging
This commit is contained in:
parent
20882990e0
commit
465f07a9b7
@ -10,11 +10,12 @@ PlayerTech::PlayerTech(Json const& json) {
|
|||||||
m_availableTechs = jsonToStringSet(json.get("availableTechs"));
|
m_availableTechs = jsonToStringSet(json.get("availableTechs"));
|
||||||
m_enabledTechs = jsonToStringSet(json.get("enabledTechs"));
|
m_enabledTechs = jsonToStringSet(json.get("enabledTechs"));
|
||||||
auto techDatabase = Root::singleton().techDatabase();
|
auto techDatabase = Root::singleton().techDatabase();
|
||||||
for (auto p : json.get("equippedTechs", JsonObject()).iterateObject()) {
|
for (auto& p : json.getObject("equippedTechs")) {
|
||||||
if (techDatabase->contains(p.second.toString()))
|
String techName = p.second.toString();
|
||||||
m_equippedTechs.set(TechTypeNames.getLeft(p.first), p.second.toString());
|
if (techDatabase->contains(techName))
|
||||||
|
m_equippedTechs.set(TechTypeNames.getLeft(p.first), techName);
|
||||||
else
|
else
|
||||||
Logger::warn("Missing tech '%s' in slot '%s'", p.second.toString(), p.first);
|
Logger::warn("Unequipping unknown tech '{}' from slot '{}'", techName, p.first);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user