mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 13:30:06 +00:00
Merge pull request #59 from JadeShrineMaiden/additions
Colliding NPC IID quickfix
This commit is contained in:
commit
7e9793bf90
@ -15,6 +15,8 @@ std::vector<WarpLocation> NPCManager::RespawnPoints;
|
|||||||
|
|
||||||
void NPCManager::init() {
|
void NPCManager::init() {
|
||||||
// load NPCs from NPCs.json into our NPC manager
|
// load NPCs from NPCs.json into our NPC manager
|
||||||
|
// Temporary fix, IDs will be pulled from json later
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
std::ifstream inFile(settings::NPCJSON);
|
std::ifstream inFile(settings::NPCJSON);
|
||||||
@ -25,6 +27,11 @@ void NPCManager::init() {
|
|||||||
|
|
||||||
for (nlohmann::json::iterator npc = npcData.begin(); npc != npcData.end(); npc++) {
|
for (nlohmann::json::iterator npc = npcData.begin(); npc != npcData.end(); npc++) {
|
||||||
BaseNPC tmp(npc.value()["x"], npc.value()["y"], npc.value()["z"], npc.value()["id"]);
|
BaseNPC tmp(npc.value()["x"], npc.value()["y"], npc.value()["z"], npc.value()["id"]);
|
||||||
|
|
||||||
|
// Temporary fix, IDs will be pulled from json later
|
||||||
|
tmp.appearanceData.iNPC_ID = i;
|
||||||
|
i++;
|
||||||
|
|
||||||
NPCs[tmp.appearanceData.iNPC_ID] = tmp;
|
NPCs[tmp.appearanceData.iNPC_ID] = tmp;
|
||||||
|
|
||||||
if (npc.value()["id"] == 641 || npc.value()["id"] == 642)
|
if (npc.value()["id"] == 641 || npc.value()["id"] == 642)
|
||||||
@ -48,6 +55,10 @@ void NPCManager::init() {
|
|||||||
BaseNPC tmp(npc.value()["iX"], npc.value()["iY"], npc.value()["iZ"], npc.value()["iNPCType"],
|
BaseNPC tmp(npc.value()["iX"], npc.value()["iY"], npc.value()["iZ"], npc.value()["iNPCType"],
|
||||||
npc.value()["iHP"], npc.value()["iConditionBitFlag"], npc.value()["iAngle"], npc.value()["iBarkerType"]);
|
npc.value()["iHP"], npc.value()["iConditionBitFlag"], npc.value()["iAngle"], npc.value()["iBarkerType"]);
|
||||||
|
|
||||||
|
// Temporary fix, IDs will be pulled from json later
|
||||||
|
tmp.appearanceData.iNPC_ID = i;
|
||||||
|
i++;
|
||||||
|
|
||||||
NPCs[tmp.appearanceData.iNPC_ID] = tmp;
|
NPCs[tmp.appearanceData.iNPC_ID] = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user