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

Method loadTraps

source/utils/ConfigManager.cpp:953–984  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

951}
952
953bool ConfigManager::loadTraps(const std::string& fileName)
954{
955 OD_LOG_INF("Load traps file: " + fileName);
956 std::stringstream defFile;
957 if(!Helper::readFileWithoutComments(fileName, defFile))
958 {
959 OD_LOG_ERR("Couldn't read " + fileName);
960 return false;
961 }
962
963 std::string nextParam;
964 // Read in the creature class descriptions
965 defFile >> nextParam;
966 if (nextParam != "[Traps]")
967 {
968 OD_LOG_ERR("Invalid Traps start format. Line was " + nextParam);
969 return false;
970 }
971
972 while(defFile.good())
973 {
974 if(!(defFile >> nextParam))
975 break;
976
977 if (nextParam == "[/Traps]")
978 break;
979
980 defFile >> mTrapsConfig[nextParam];
981 }
982
983 return true;
984}
985
986bool ConfigManager::loadSpellConfig(const std::string& fileName)
987{

Callers

nothing calls this directly

Calls 1

readFileWithoutCommentsFunction · 0.85

Tested by

no test coverage detected