Clean up redundant forced chunk updates for NPCs

This commit is contained in:
Gent S 2020-11-21 11:53:48 -05:00
parent c5fa397724
commit 665f28313a
3 changed files with 0 additions and 6 deletions

View File

@ -459,8 +459,6 @@ void ChunkManager::createInstance(uint64_t instanceID) {
}
NPCManager::updateNPCPosition(newID, baseNPC->appearanceData.iX, baseNPC->appearanceData.iY, baseNPC->appearanceData.iZ,
instanceID, baseNPC->appearanceData.iAngle);
// force chunk update
updateNPCChunk(newID, std::make_tuple(0, 0, 0), chunkPosAt(baseNPC->appearanceData.iX, baseNPC->appearanceData.iY, instanceID));
}
}
} else {

View File

@ -483,8 +483,6 @@ void NPCManager::npcSummonHandler(CNSocket* sock, CNPacketData* data) {
NPCs[id] = new BaseNPC(plr->x, plr->y, plr->z, 0, plr->instanceID, req->iNPCType, id);
updateNPCPosition(id, plr->x, plr->y, plr->z, plr->instanceID, 0);
// force chunk update
ChunkManager::updateNPCChunk(id, std::make_tuple(0, 0, 0), ChunkManager::chunkPosAt(plr->x, plr->y, plr->instanceID));
}
}

View File

@ -44,7 +44,6 @@ void TableData::init() {
NPCManager::NPCs[nextId] = tmp;
NPCManager::updateNPCPosition(nextId, npc["x"], npc["y"], npc["z"], instanceID, npc["angle"]);
ChunkManager::updateNPCChunk(nextId, std::make_tuple(0, 0, 0), ChunkManager::chunkPosAt(npc["x"], npc["y"], instanceID));
nextId++;
if (npc["id"] == 641 || npc["id"] == 642)
@ -212,7 +211,6 @@ void TableData::init() {
NPCManager::NPCs[nextId] = tmp;
MobManager::Mobs[nextId] = (Mob*)NPCManager::NPCs[nextId];
NPCManager::updateNPCPosition(nextId, npc["iX"], npc["iY"], npc["iZ"], instanceID, npc["iAngle"]);
ChunkManager::updateNPCChunk(nextId, std::make_tuple(0, 0, 0), ChunkManager::chunkPosAt(npc["iX"], npc["iY"], instanceID));
nextId++;
}