diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-12-17 20:24:43 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-12-21 01:38:16 +0300 |
commit | 575b83e553b1b02a05a6cf9732d6b761b522cd74 (patch) | |
tree | d649adf6faf211e8bcbcc1aaf1c5889c0065a54f /src/map | |
parent | 220d882bc33baad69db55ade4ea41b845b0e9611 (diff) | |
download | hercules-575b83e553b1b02a05a6cf9732d6b761b522cd74.tar.gz hercules-575b83e553b1b02a05a6cf9732d6b761b522cd74.tar.bz2 hercules-575b83e553b1b02a05a6cf9732d6b761b522cd74.tar.xz hercules-575b83e553b1b02a05a6cf9732d6b761b522cd74.zip |
Remove plugin data in mob_data destruction.
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/unit.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/map/unit.c b/src/map/unit.c index 0924e6cf2..e23eb42ac 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -2720,6 +2720,7 @@ int unit_free(struct block_list *bl, clr_type clrtype) { } case BL_MOB: { + unsigned int k; struct mob_data *md = (struct mob_data*)bl; if( md->spawn_timer != INVALID_TIMER ) { @@ -2774,6 +2775,15 @@ int unit_free(struct block_list *bl, clr_type clrtype) { mob->clone_delete(md); if( md->tomb_nid ) mob->mvptomb_destroy(md); + + for (k = 0; k < md->hdatac; k++) { + if( md->hdata[k]->flag.free ) { + aFree(md->hdata[k]->data); + } + aFree(md->hdata[k]); + } + if (md->hdata) + aFree(md->hdata); break; } case BL_HOM: |