MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / loadSpellConfig

Method loadSpellConfig

source/utils/ConfigManager.cpp:986–1017  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

984}
985
986bool ConfigManager::loadSpellConfig(const std::string& fileName)
987{
988 OD_LOG_INF("Load Spell config file: " + fileName);
989 std::stringstream defFile;
990 if(!Helper::readFileWithoutComments(fileName, defFile))
991 {
992 OD_LOG_ERR("Couldn't read " + fileName);
993 return false;
994 }
995
996 std::string nextParam;
997 // Read in the creature class descriptions
998 defFile >> nextParam;
999 if (nextParam != "[Spells]")
1000 {
1001 OD_LOG_ERR("Invalid Spells start format. Line was " + nextParam);
1002 return false;
1003 }
1004
1005 while(defFile.good())
1006 {
1007 if(!(defFile >> nextParam))
1008 break;
1009
1010 if (nextParam == "[/Spells]")
1011 break;
1012
1013 defFile >> mSpellConfig[nextParam];
1014 }
1015
1016 return true;
1017}
1018
1019bool ConfigManager::loadSkills(const std::string& fileName)
1020{

Callers

nothing calls this directly

Calls 1

readFileWithoutCommentsFunction · 0.85

Tested by

no test coverage detected