| 951 | } |
| 952 | |
| 953 | bool 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 | |
| 986 | bool ConfigManager::loadSpellConfig(const std::string& fileName) |
| 987 | { |
nothing calls this directly
no test coverage detected