tiny perf fix

这个提交包含在:
otfallen 2012-09-23 01:18:48 +00:00
父节点 8f9d7593d6
当前提交 7f6b204ded
共有 1 个文件被更改,包括 5 次插入4 次删除

查看文件

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