summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-10-02 10:58:11 -0700
committerBen Longbons <b.r.longbons@gmail.com>2013-10-02 10:58:11 -0700
commit59ce78ce5c6f7e40583aa2369842f323e182ff76 (patch)
tree7cdd9426f561b4e6c5b54a947b0b0ba776592221
parent5b87991fa45fbdea5799a450321983419da75298 (diff)
downloadtmwa-59ce78ce5c6f7e40583aa2369842f323e182ff76.tar.gz
tmwa-59ce78ce5c6f7e40583aa2369842f323e182ff76.tar.bz2
tmwa-59ce78ce5c6f7e40583aa2369842f323e182ff76.tar.xz
tmwa-59ce78ce5c6f7e40583aa2369842f323e182ff76.zip
Remove asserts in npc_checknearv13.10.2
Somebody is calling this with an invalid ID somewhere. I really need to get the pointer-hoisting done ...
-rw-r--r--src/map/npc.cpp7
1 files 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<map_session_data> 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;