Fix for EntityList::CheckSpawnQueue() debug assertion failure crash

This commit is contained in:
Uleat
2015-05-15 22:49:59 -04:00
parent 4b7871a665
commit 2308d3e880
2 changed files with 12 additions and 3 deletions
+9 -3
View File
@@ -736,9 +736,15 @@ void EntityList::CheckSpawnQueue()
Mob::CreateSpawnPacket(outapp, ns);
QueueClients(0, outapp);
auto it = npc_list.find(ns->spawn.spawnId);
NPC *pnpc = it->second;
pnpc->SendArmorAppearance();
pnpc->SetAppearance(pnpc->GetGuardPointAnim(),false);
if (it == npc_list.end()) {
// We must of despawned, hope that's the reason!
Log.Out(Logs::General, Logs::Error, "Error in EntityList::CheckSpawnQueue: Unable to find NPC for spawnId '%u'", ns->spawn.spawnId);
}
else {
NPC *pnpc = it->second;
pnpc->SendArmorAppearance();
pnpc->SetAppearance(pnpc->GetGuardPointAnim(), false);
}
safe_delete(outapp);
iterator.RemoveCurrent();
}