diff --git a/apps/openmw/mwworld/esmstore.cpp b/apps/openmw/mwworld/esmstore.cpp index 137c9cf026..d5d2c03b8b 100644 --- a/apps/openmw/mwworld/esmstore.cpp +++ b/apps/openmw/mwworld/esmstore.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include "../mwmechanics/spelllist.hpp" #include "../mwrender/actorutil.hpp" @@ -140,22 +141,17 @@ namespace // TESCS sometimes writes the default animation nif to the animation subrecord. This harmless (as it // will match the NPC's race) until the NPC's race is changed. If the player record contains a default // non-beast race animation and the player selects a beast race in chargen, animations aren't applied - // properly. Morrowind.exe handles this gracefully, so we clear the animation here to force the default. + // properly. Morrowind.exe handles this gracefully, so we clear the animation here to force the default + // values to be used. if (!npc.mModel.empty() && npc.mId == "player") { const bool isBeast = (race->mData.mFlags & ESM::Race::Beast) != 0; const std::string& defaultModel = MWRender::getActorSkeleton(false, !npc.isMale(), isBeast, false); std::string model = Misc::ResourceHelpers::correctMeshPath(npc.mModel); - if (model.size() == defaultModel.size()) + if (VFS::Path::pathEqual(defaultModel, model)) { - std::replace(model.begin(), model.end(), '/', '\\'); - std::string normalizedDefault = defaultModel; - std::replace(normalizedDefault.begin(), normalizedDefault.end(), '/', '\\'); - if (Misc::StringUtils::ciEqual(normalizedDefault, model)) - { - npc.mModel.clear(); - changed = true; - } + npc.mModel.clear(); + changed = true; } } }