summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-17 18:50:37 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-21 01:38:12 +0300
commit220d882bc33baad69db55ade4ea41b845b0e9611 (patch)
treed2752a6c10290d86f8167f88db87f65f601bb1c4 /src/map
parent6986718327b15180bed128037addbd6fcd558005 (diff)
downloadhercules-220d882bc33baad69db55ade4ea41b845b0e9611.tar.gz
hercules-220d882bc33baad69db55ade4ea41b845b0e9611.tar.bz2
hercules-220d882bc33baad69db55ade4ea41b845b0e9611.tar.xz
hercules-220d882bc33baad69db55ade4ea41b845b0e9611.zip
Remove plugin data in mob_db destruction.
Diffstat (limited to 'src/map')
-rw-r--r--src/map/mob.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index ad8615678..8fe3e3cef 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -34,6 +34,7 @@
#include "script.h"
#include "skill.h"
#include "status.h"
+#include "../common/HPM.h"
#include "../common/cbasetypes.h"
#include "../common/db.h"
#include "../common/ers.h"
@@ -4701,7 +4702,17 @@ int do_init_mob(bool minimal) {
void mob_destroy_mob_db(int index)
{
- aFree(mob->db_data[index]);
+ struct mob_db *data = mob->db_data[index];
+ int v;
+ for (v = 0; v < data->hdatac; v++ ) {
+ if (data->hdata[v]->flag.free ) {
+ aFree(data->hdata[v]->data);
+ }
+ aFree(data->hdata[v]);
+ }
+ if (data->hdata)
+ aFree(data->hdata);
+ aFree(data);
mob->db_data[index] = NULL;
}