From 6b9f58446c46877ecfc5fe40847636145acf5af8 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sun, 4 Aug 2013 12:19:25 -0300 Subject: HPM Update - Custom Packet Support - Custom Data Struct Support (currently append-able to map_session_data and socket_data) - Char Server Support - Login Server Support http://hercules.ws/board/topic/1934-hercules-plugin-manager-update/ Documentation will soon be updated in http://hercules.ws/wiki/HPM Signed-off-by: shennetsind --- src/map/unit.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/map/unit.c') diff --git a/src/map/unit.c b/src/map/unit.c index 9becb128e..41d661169 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -8,6 +8,7 @@ #include "../common/db.h" #include "../common/malloc.h" #include "../common/random.h" +#include "../common/HPM.h" #include "map.h" #include "path.h" @@ -2330,6 +2331,7 @@ int unit_free(struct block_list *bl, clr_type clrtype) { struct map_session_data *sd = (struct map_session_data*)bl; int i; + unsigned int k; if( iStatus->isdead(bl) ) pc->setrestartvalue(sd,2); @@ -2397,6 +2399,15 @@ int unit_free(struct block_list *bl, clr_type clrtype) aFree(sd->queues); sd->queues = NULL; } + + for( k = 0; k < sd->hdatac; k++ ) { + if( sd->hdata[k]->flag.free ) { + aFree(sd->hdata[k]->data); + aFree(sd->hdata[k]); + } + } + if( sd->hdata ) + aFree(sd->hdata); break; } case BL_PET: -- cgit v1.2.3-60-g2f50