summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorHaruna <haru@dotalux.com>2014-12-20 23:42:37 +0100
committerHaruna <haru@dotalux.com>2014-12-20 23:42:37 +0100
commit1134e030744e67bca61f52dc97075f33932f7a38 (patch)
tree3c5f077c6537f7e165039d3bf68d8052253b7dc2 /src/map/unit.c
parentc4456ddbebccaca51ab040c60e3c586ed2cc0a10 (diff)
parent2c6fd58d633e4139a6f0f3b4bb0262e64fc957e2 (diff)
downloadhercules-1134e030744e67bca61f52dc97075f33932f7a38.tar.gz
hercules-1134e030744e67bca61f52dc97075f33932f7a38.tar.bz2
hercules-1134e030744e67bca61f52dc97075f33932f7a38.tar.xz
hercules-1134e030744e67bca61f52dc97075f33932f7a38.zip
Merge pull request #416 from 4144/plugext
Extend plugins support in item_data, mob_db, mob_data
Diffstat (limited to 'src/map/unit.c')
-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: