summaryrefslogtreecommitdiff
path: root/src/emap/status.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-06-28 18:09:13 +0300
committerAndrei Karas <akaras@inbox.ru>2016-06-28 18:09:13 +0300
commit8cf325640e316aff125deeff3d2880bb342d00c9 (patch)
tree2f5aabe104fcba2a36022a098a839ff04f6c2b36 /src/emap/status.c
parentf68e125478e7b74fdc7e9c272449ae0c5c227d1c (diff)
downloadevol-hercules-8cf325640e316aff125deeff3d2880bb342d00c9.tar.gz
evol-hercules-8cf325640e316aff125deeff3d2880bb342d00c9.tar.bz2
evol-hercules-8cf325640e316aff125deeff3d2880bb342d00c9.tar.xz
evol-hercules-8cf325640e316aff125deeff3d2880bb342d00c9.zip
Fix memory leak if npc change class.s20160630
Diffstat (limited to 'src/emap/status.c')
-rw-r--r--src/emap/status.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/emap/status.c b/src/emap/status.c
index 1b27a0f..13592b5 100644
--- a/src/emap/status.c
+++ b/src/emap/status.c
@@ -39,6 +39,17 @@ void status_init(void)
class_move_speed[f] = 150;
}
+void estatus_set_viewdata_pre(struct block_list **blPtr,
+ int *classPtr_ __attribute__ ((unused)))
+{
+ struct block_list *bl = *blPtr;
+ if (bl->type != BL_NPC)
+ return;
+ TBL_NPC *const npc = (TBL_NPC*)bl;
+ aFree(npc->vd);
+ npc->vd = NULL;
+}
+
void estatus_set_viewdata_post(struct block_list *bl,
int class_ __attribute__ ((unused)))
{