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