From 59ce78ce5c6f7e40583aa2369842f323e182ff76 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Wed, 2 Oct 2013 10:58:11 -0700 Subject: Remove asserts in npc_checknear Somebody is calling this with an invalid ID somewhere. I really need to get the pointer-hoisting done ... --- src/map/npc.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/map/npc.cpp b/src/map/npc.cpp index e859e2d..bca4eab 100644 --- a/src/map/npc.cpp +++ b/src/map/npc.cpp @@ -602,8 +602,11 @@ int npc_checknear(dumb_ptr sd, int id) nullpo_ret(sd); nd = map_id_as_npc(id); - assert (nd != NULL); - assert (nd->bl_type == BL::NPC); + // this actually happens + if (nd == NULL) + return 1; + if (nd->bl_type != BL::NPC) + return 1; if (nd->npc_class < 0) // イベント系は常にOK return 0; -- cgit v1.2.3-60-g2f50