diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-10-02 10:58:11 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-10-02 10:58:11 -0700 |
commit | 59ce78ce5c6f7e40583aa2369842f323e182ff76 (patch) | |
tree | 7cdd9426f561b4e6c5b54a947b0b0ba776592221 /src/map/npc.cpp | |
parent | 5b87991fa45fbdea5799a450321983419da75298 (diff) | |
download | tmwa-13.10.2.tar.gz tmwa-13.10.2.tar.bz2 tmwa-13.10.2.tar.xz tmwa-13.10.2.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 ...
Diffstat (limited to 'src/map/npc.cpp')
-rw-r--r-- | src/map/npc.cpp | 7 |
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; |