diff options
Diffstat (limited to 'src/map/unit.c')
-rw-r--r-- | src/map/unit.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/map/unit.c b/src/map/unit.c index a5bd282a9..deb061f78 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -2657,14 +2657,16 @@ int unit_free(struct block_list *bl, clr_type clrtype) { sd->num_quests = sd->avail_quests = 0; } - 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 ) + { + for( k = 0; k < sd->hdatac; k++ ) { + if( sd->hdata[k]->flag.free ) { + aFree(sd->hdata[k]->data); + } + aFree(sd->hdata[k]); + } aFree(sd->hdata); + } break; } case BL_PET: @@ -2776,14 +2778,16 @@ int unit_free(struct block_list *bl, clr_type clrtype) { 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) + { + for (k = 0; k < md->hdatac; k++) { + if( md->hdata[k]->flag.free ) { + aFree(md->hdata[k]->data); + } + aFree(md->hdata[k]); + } aFree(md->hdata); + } break; } case BL_HOM: |