Fix naming scheme in NPCs.json

This commit is contained in:
gsemaj 2021-04-24 11:36:33 -04:00
parent 2e34440d2e
commit 80d965944c
2 changed files with 7 additions and 7 deletions

View File

@ -567,22 +567,22 @@ void TableData::init() {
npcData = npcData["NPCs"];
for (nlohmann::json::iterator _npc = npcData.begin(); _npc != npcData.end(); _npc++) {
auto npc = _npc.value();
int instanceID = npc.find("mapNum") == npc.end() ? INSTANCE_OVERWORLD : (int)npc["mapNum"];
int instanceID = npc.find("iMapNum") == npc.end() ? INSTANCE_OVERWORLD : (int)npc["iMapNum"];
#ifdef ACADEMY
// do not spawn NPCs in the future
if (npc["x"] > 512000 && npc["y"] < 256000) {
if (npc["iX"] > 512000 && npc["iY"] < 256000) {
nextId++;
continue;
}
#endif
BaseNPC *tmp = new BaseNPC(npc["x"], npc["y"], npc["z"], npc["angle"], instanceID, npc["id"], nextId);
BaseNPC *tmp = new BaseNPC(npc["iX"], npc["iY"], npc["iZ"], npc["iAngle"], instanceID, npc["iNPCType"], nextId);
NPCManager::NPCs[nextId] = tmp;
NPCManager::updateNPCPosition(nextId, npc["x"], npc["y"], npc["z"], instanceID, npc["angle"]);
NPCManager::updateNPCPosition(nextId, npc["iX"], npc["iY"], npc["iZ"], instanceID, npc["iAngle"]);
nextId++;
if (npc["id"] == 641 || npc["id"] == 642)
NPCManager::RespawnPoints.push_back({ npc["x"], npc["y"], ((int)npc["z"]) + RESURRECT_HEIGHT, instanceID });
if (npc["iNPCType"] == 641 || npc["iNPCType"] == 642)
NPCManager::RespawnPoints.push_back({ npc["iX"], npc["iY"], ((int)npc["iZ"]) + RESURRECT_HEIGHT, instanceID });
}
}
catch (const std::exception& err) {

2
tdata

@ -1 +1 @@
Subproject commit f822f1640d8cf0e46539b75f561aeaeb1d68c9a9
Subproject commit ef62dddee1c568996599a2ceb7316bd92f84ec5e