diff --git a/config.ini b/config.ini index c179144..da4acea 100644 --- a/config.ini +++ b/config.ini @@ -28,6 +28,8 @@ motd=Welcome to OpenFusion! npcdata=data/NPCs.json # warp target json data warpdata=data/warps.json +# mob json +mobdata=data/mobs.json # is everyone a GM? gm=true diff --git a/src/NPCManager.cpp b/src/NPCManager.cpp index c58780a..2e829f8 100644 --- a/src/NPCManager.cpp +++ b/src/NPCManager.cpp @@ -45,7 +45,7 @@ void NPCManager::init() { // load temporary mob dump try { - std::ifstream inFile("data/mobs.json"); // not in settings, since it's temp + std::ifstream inFile(settings::MOBJSON); // not in settings, since it's temp nlohmann::json npcData; // read file into json diff --git a/src/settings.cpp b/src/settings.cpp index f030f8d..474f886 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -21,6 +21,7 @@ int settings::SPAWN_Z = -4210; std::string settings::GMPASS = "pass"; std::string settings::NPCJSON = "data/NPCs.json"; std::string settings::WARPJSON = "data/warps.json"; +std::string settings::MOBJSON = "data/mobs.json"; std::string settings::MOTDSTRING = "Welcome to OpenFusion!"; bool settings::GM = false; @@ -50,6 +51,7 @@ void settings::init() { GMPASS = reader.Get("login", "pass", GMPASS); NPCJSON = reader.Get("shard", "npcdata", NPCJSON); WARPJSON = reader.Get("shard", "warpdata", WARPJSON); + MOBJSON = reader.Get("shard", "mobdata", MOBJSON); MOTDSTRING = reader.Get("shard", "motd", MOTDSTRING); GM = reader.GetBoolean("shard", "gm", GM); } diff --git a/src/settings.hpp b/src/settings.hpp index 7accc2a..51483e2 100644 --- a/src/settings.hpp +++ b/src/settings.hpp @@ -15,6 +15,7 @@ namespace settings { extern std::string MOTDSTRING; extern std::string NPCJSON; extern std::string WARPJSON; + extern std::string MOBJSON; extern std::string GMPASS; extern bool GM;