diff options
author | Andrei Karas <akaras@inbox.ru> | 2020-05-18 02:09:22 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2020-06-01 01:08:50 +0300 |
commit | 495f4b84f775030e189209704387ee97adb20ee0 (patch) | |
tree | c1cdf2f1ff4d9c8441ca12a20200bf1d653d90eb /src | |
parent | e651febbafb417e0cbc7cd8018b5dd1c436c03ee (diff) | |
download | hercules-495f4b84f775030e189209704387ee97adb20ee0.tar.gz hercules-495f4b84f775030e189209704387ee97adb20ee0.tar.bz2 hercules-495f4b84f775030e189209704387ee97adb20ee0.tar.xz hercules-495f4b84f775030e189209704387ee97adb20ee0.zip |
Dont call clif->clearunit_area if mob died on missing map
Diffstat (limited to 'src')
-rw-r--r-- | src/map/clif.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 836259483..12242e44c 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -936,8 +936,15 @@ static void clif_clearunit_area(struct block_list *bl, enum clr_type type) static int clif_clearunit_delayed_sub(int tid, int64 tick, int id, intptr_t data) { struct block_list *bl = (struct block_list *)data; + nullpo_ret(bl); + Assert_ret(bl->m >= 0 && bl->m < map->count); + if (map->list[bl->m].block == NULL) { + // avoid error report for missing/removed map + ers_free(clif->delay_clearunit_ers, bl); + return 0; + } clif->clearunit_area(bl, (enum clr_type) id); - ers_free(clif->delay_clearunit_ers,bl); + ers_free(clif->delay_clearunit_ers, bl); return 0; } |