summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/emap/init.c1
-rw-r--r--src/emap/status.c11
-rw-r--r--src/emap/status.h2
3 files changed, 14 insertions, 0 deletions
diff --git a/src/emap/init.c b/src/emap/init.c
index a355e2b..0882db6 100644
--- a/src/emap/init.c
+++ b/src/emap/init.c
@@ -252,6 +252,7 @@ HPExport void plugin_init (void)
addHookPre(script, load_parameters, escript_load_parameters_pre);
addHookPre(script, hardcoded_constants, escript_hardcoded_constants_pre);
addHookPre(status, calc_pc_additional, estatus_calc_pc_additional_pre);
+ addHookPre(status, set_viewdata, estatus_set_viewdata_pre);
addHookPost(clif, addcards, eclif_addcards_post);
addHookPost(clif, addcards2, eclif_addcards2_post);
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)))
{
diff --git a/src/emap/status.h b/src/emap/status.h
index fce6c83..62bbec7 100644
--- a/src/emap/status.h
+++ b/src/emap/status.h
@@ -5,6 +5,8 @@
#define EVOL_MAP_STATUS
void status_init(void);
+void estatus_set_viewdata_pre(struct block_list **blPtr,
+ int *classPtr_ __attribute__ ((unused)));
void estatus_set_viewdata_post(struct block_list *bl,
int class_);
void estatus_read_job_db_sub_post(int idx,