diff options
author | Andrei Karas <akaras@inbox.ru> | 2020-05-18 02:09:22 +0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-02-15 16:37:28 -0300 |
commit | 915a7ea8715655da5d02d8f556857db752b6d98a (patch) | |
tree | 4e635844d79a58293bc0fb0a1298388040d2fe3e /src | |
parent | 27d1cb055365579e0c4ff90ac1fcf17d5280a627 (diff) | |
download | hercules-915a7ea8715655da5d02d8f556857db752b6d98a.tar.gz hercules-915a7ea8715655da5d02d8f556857db752b6d98a.tar.bz2 hercules-915a7ea8715655da5d02d8f556857db752b6d98a.tar.xz hercules-915a7ea8715655da5d02d8f556857db752b6d98a.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 3289e80c5..1d4240350 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; } |