Rework NPCs loader with g_resources (Untested)

This commit is contained in:
Allan Ference 2013-08-17 23:36:44 +02:00
parent 5eabf6f518
commit e7137c2535
1 changed files with 4 additions and 12 deletions

View File

@ -197,20 +197,12 @@ void CreatureManager::loadNpcs(const std::string& folder)
if(!stdext::ends_with(tmp, "/"))
tmp += "/";
// FIXME: filesystem is not supported anymore, rework the following code with g_resources
/*
boost::filesystem::path npcPath(boost::filesystem::current_path().generic_string() + tmp);
if(!boost::filesystem::exists(npcPath))
if(!g_resources.directoryExists(tmp))
stdext::throw_exception(stdext::format("NPCs folder '%s' was not found.", folder));
for(boost::filesystem::directory_iterator it(npcPath), end; it != end; ++it) {
std::string f = it->path().filename().string();
if(boost::filesystem::is_directory(it->status()))
continue;
loadCreatureBuffer(g_resources.readFileContents(tmp + f));
}
*/
const auto& fileList = g_resources.listDirectoryFiles(tmp);
for(const std::string& file : fileList)
loadCreatureBuffer(g_resources.readFileContents(tmp + file));
}
void CreatureManager::loadSpawns(const std::string& fileName)