diff --git a/lib/entities/faction/CTownHandler.cpp b/lib/entities/faction/CTownHandler.cpp index badfa92e9..9896039a2 100644 --- a/lib/entities/faction/CTownHandler.cpp +++ b/lib/entities/faction/CTownHandler.cpp @@ -331,7 +331,7 @@ void CTownHandler::loadBuilding(CTown * town, const std::string & stringID, cons //MODS COMPATIBILITY FOR pre-1.6 if(ret->produce.empty() && ret->bid == BuildingID::RESOURCE_SILO) { - logGlobal->warn("Resource silo in town '%s' does not produces any resources!", ret->town->faction->getJsonKey()); + logGlobal->warn("Resource silo in town '%s' does not produce any resources!", ret->town->faction->getJsonKey()); switch (ret->town->primaryRes.toEnum()) { case EGameResID::GOLD: diff --git a/lib/json/JsonUtils.cpp b/lib/json/JsonUtils.cpp index ef9c81c7b..112a29381 100644 --- a/lib/json/JsonUtils.cpp +++ b/lib/json/JsonUtils.cpp @@ -34,7 +34,7 @@ static std::optional getIndexSafe(const JsonNode & node, const std::string } catch(const std::out_of_range & ) { - logMod->warn("Failed to replace index when replacing individual items in array. Value '%s' does not exists in targeted array of %d items", keyName, node.Vector().size()); + logMod->warn("Failed to replace index when replacing individual items in array. Value '%s' does not exist in targeted array of %d items", keyName, node.Vector().size()); return std::nullopt; } }; @@ -253,14 +253,14 @@ void JsonUtils::merge(JsonNode & dest, JsonNode & source, bool ignoreOverride, b else if (boost::algorithm::starts_with(node.first, "insert@")) { constexpr int numberPosition = std::char_traits::length("insert@"); - auto index = getIndexSafe(node.second, node.first.substr(numberPosition)); + auto index = getIndexSafe(dest, node.first.substr(numberPosition)); if (index) dest.Vector().insert(dest.Vector().begin() + index.value(), std::move(node.second)); } else if (boost::algorithm::starts_with(node.first, "modify@")) { constexpr int numberPosition = std::char_traits::length("modify@"); - auto index = getIndexSafe(node.second, node.first.substr(numberPosition)); + auto index = getIndexSafe(dest, node.first.substr(numberPosition)); if (index) merge(dest.Vector().at(index.value()), node.second, ignoreOverride); } diff --git a/lib/modding/ContentTypeHandler.cpp b/lib/modding/ContentTypeHandler.cpp index 941b18bb0..4e1abf178 100644 --- a/lib/modding/ContentTypeHandler.cpp +++ b/lib/modding/ContentTypeHandler.cpp @@ -154,7 +154,7 @@ bool ContentTypeHandler::loadMod(const std::string & modName, bool validate) { // normal new object logMod->trace("no index in loadMod(%s)", name); - performValidate(data,name); + performValidate(data, name); handler->loadObject(modName, name, data); } }