From 70265291d62280c525adc317158e9f531e0147ff Mon Sep 17 00:00:00 2001 From: Haru Date: Thu, 17 Sep 2015 01:21:28 +0200 Subject: Cleanup of the HPluginData implementation (First part) - Several explicit casts are removed, to have a slightly better type-checking at compile time. - A destructor function is provided, to remove code duplication. Signed-off-by: Haru --- src/map/itemdb.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/map/itemdb.c') diff --git a/src/map/itemdb.c b/src/map/itemdb.c index ccedee72a..c531a4d7a 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -2100,17 +2100,8 @@ void destroy_item_data(struct item_data* self, int free_self) script->free_code(self->unequip_script); if( self->combos ) aFree(self->combos); - if (self->hdata) - { - int i; - for (i = 0; i < self->hdatac; i++ ) { - if (self->hdata[i]->flag.free ) { - aFree(self->hdata[i]->data); - } - aFree(self->hdata[i]); - } - aFree(self->hdata); - } + HPM->data_store_destroy(self->hdata); + self->hdata = NULL; #if defined(DEBUG) // trash item memset(self, 0xDD, sizeof(struct item_data)); -- cgit v1.2.3-70-g09d2