Remove redundant Mob map

This commit is contained in:
gsemaj
2021-04-06 20:43:43 -04:00
committed by dongresource
parent 65462d01e3
commit fd965fbf03
8 changed files with 128 additions and 86 deletions

View File

@@ -59,10 +59,6 @@ void NPCManager::destroyNPC(int32_t id) {
// remove from viewable chunks
Chunking::removeEntityFromChunks(Chunking::getViewableChunks(entity->chunkPos), ref);
// remove from mob manager
if (MobAI::Mobs.find(id) != MobAI::Mobs.end())
MobAI::Mobs.erase(id);
// finally, remove it from the map and free it
NPCs.erase(id);
delete entity;
@@ -134,7 +130,6 @@ BaseNPC *NPCManager::summonNPC(int x, int y, int z, uint64_t instance, int type,
if (team == 2) {
npc = new Mob(x, y, z + EXTRA_HEIGHT, inst, type, NPCData[type], id);
MobAI::Mobs[id] = (Mob*)npc;
// re-enable respawning, if desired
((Mob*)npc)->summoned = !respawn;