diff --git a/src/otclient/creatures.cpp b/src/otclient/creatures.cpp index 9fde671d..c7bff20c 100644 --- a/src/otclient/creatures.cpp +++ b/src/otclient/creatures.cpp @@ -185,7 +185,11 @@ void CreatureManager::loadSingleCreature(const std::string& file) void CreatureManager::loadNpcs(const std::string& folder) { - boost::filesystem::path npcPath(boost::filesystem::current_path().generic_string() + folder); + std::string tmp = folder; + if(!stdext::ends_with(tmp, "/")) + tmp += "/"; + + boost::filesystem::path npcPath(boost::filesystem::current_path().generic_string() + tmp); if(!boost::filesystem::exists(npcPath)) stdext::throw_exception(stdext::format("NPCs folder '%s' was not found.", folder)); @@ -194,9 +198,6 @@ void CreatureManager::loadNpcs(const std::string& folder) if(boost::filesystem::is_directory(it->status())) continue; - std::string tmp = folder; - if(!stdext::ends_with(tmp, "/")) - tmp += "/"; loadCreatureBuffer(g_resources.loadFile(tmp + f)); } }