summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-17 20:24:43 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-21 01:38:16 +0300
commit575b83e553b1b02a05a6cf9732d6b761b522cd74 (patch)
treed649adf6faf211e8bcbcc1aaf1c5889c0065a54f /src/map
parent220d882bc33baad69db55ade4ea41b845b0e9611 (diff)
downloadhercules-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.c10
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: