summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2014-01-11 14:02:59 -0200
committershennetsind <ind@henn.et>2014-01-11 14:02:59 -0200
commit82b583b5ef4e729ad2c3c74b26adce16a145605a (patch)
tree5bb20b90edd899b06abe9853dba06383a9379c06 /src/map/unit.c
parent56649bda4b2f62cf42847830546b5856234b3178 (diff)
downloadhercules-82b583b5ef4e729ad2c3c74b26adce16a145605a.tar.gz
hercules-82b583b5ef4e729ad2c3c74b26adce16a145605a.tar.bz2
hercules-82b583b5ef4e729ad2c3c74b26adce16a145605a.tar.xz
hercules-82b583b5ef4e729ad2c3c74b26adce16a145605a.zip
Hercules 1st 2014 MegaPatch
http://hercules.ws/board/topic/3886-hercules-1st-2014-megapatch/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index 7f722684d..d801a72f0 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -2352,20 +2352,13 @@ int unit_free(struct block_list *bl, clr_type clrtype) {
pc->delspiritball(sd,sd->spiritball,1);
for(i = 1; i < 5; i++)
pc->del_charm(sd, sd->charm[i], i);
-
- if( sd->reg ) { //Double logout already freed pointer fix... [Skotlex]
- aFree(sd->reg);
- sd->reg = NULL;
- sd->reg_num = 0;
- }
- if( sd->regstr ) {
- for( i = 0; i < sd->regstr_num; ++i )
- if( sd->regstr[i].data )
- aFree(sd->regstr[i].data);
- aFree(sd->regstr);
- sd->regstr = NULL;
- sd->regstr_num = 0;
- }
+
+ if( sd->var_db )
+ sd->var_db->destroy(sd->var_db,script->reg_destroy);
+
+ if( sd->array_db )
+ sd->array_db->destroy(sd->array_db,script->array_free_db);
+
if( sd->st && sd->st->state != RUN ) {// free attached scripts that are waiting
script->free_state(sd->st);
sd->st = NULL;