diff --git a/lib/mapping/MapIdentifiersH3M.cpp b/lib/mapping/MapIdentifiersH3M.cpp index 05c35020c..9935519d8 100644 --- a/lib/mapping/MapIdentifiersH3M.cpp +++ b/lib/mapping/MapIdentifiersH3M.cpp @@ -53,11 +53,11 @@ void MapIdentifiersH3M::loadMapping(const JsonNode & mapping) for (auto entryTemplate : mapping["templates"].Struct()) { - std::string h3mName = boost::to_lower_copy(entryTemplate.second.String()); - std::string vcmiName = boost::to_lower_copy(entryTemplate.first); + AnimationPath h3mName = AnimationPath::builtinTODO(entryTemplate.second.String()); + AnimationPath vcmiName = AnimationPath::builtinTODO(entryTemplate.first); - if (!CResourceHandler::get()->existsResource(AnimationPath::builtinTODO("SPRITES/" + vcmiName))) - logMod->warn("Template animation file %s was not found!", vcmiName); + if (!CResourceHandler::get()->existsResource(vcmiName.addPrefix("SPRITES/"))) + logMod->warn("Template animation file %s was not found!", vcmiName.getOriginalName()); mappingObjectTemplate[h3mName] = vcmiName; } @@ -108,10 +108,10 @@ void MapIdentifiersH3M::loadMapping(const JsonNode & mapping) void MapIdentifiersH3M::remapTemplate(ObjectTemplate & objectTemplate) { - std::string name = boost::to_lower_copy(objectTemplate.animationFile.getName()); + auto name = objectTemplate.animationFile; if (mappingObjectTemplate.count(name)) - objectTemplate.animationFile = AnimationPath::builtinTODO(mappingObjectTemplate.at(name)); + objectTemplate.animationFile = mappingObjectTemplate.at(name); ObjectTypeIdentifier objectType{ objectTemplate.id, objectTemplate.subid}; diff --git a/lib/mapping/MapIdentifiersH3M.h b/lib/mapping/MapIdentifiersH3M.h index 71cea67dc..581a80fda 100644 --- a/lib/mapping/MapIdentifiersH3M.h +++ b/lib/mapping/MapIdentifiersH3M.h @@ -11,6 +11,7 @@ #pragma once #include "../GameConstants.h" +#include "../filesystem/ResourcePath.h" VCMI_LIB_NAMESPACE_BEGIN @@ -43,7 +44,7 @@ class MapIdentifiersH3M std::map mappingArtifact; std::map mappingSecondarySkill; - std::map mappingObjectTemplate; + std::map mappingObjectTemplate; std::map mappingObjectIndex; template