diff --git a/changelog.txt b/changelog.txt index a90c903bd..17126ff43 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 05/15/2015 == +Uleat: Added check to EntityList::CheckSpawnQueue() to bypass dereference if returned iterator is npc_list.end() - should fix the debug assertion failure crash + == 04/30/2015 == demonstar55: Implement mob and client melee push You can set Combat:MeleePush to false to turn off or change Combat:MeleePushChance to increase the chance an NPC can be pushed diff --git a/zone/entity.cpp b/zone/entity.cpp index 5646f0870..bf1f6b720 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -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(); }