tiny perf fix

This commit is contained in:
otfallen 2012-09-23 01:18:48 +00:00
parent 8f9d7593d6
commit 7f6b204ded
1 changed files with 5 additions and 4 deletions

View File

@ -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));
}
}