diff options
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/emap/init.c | 1 | ||||
-rw-r--r-- | src/emap/npc.c | 12 | ||||
-rw-r--r-- | src/emap/npc.h | 3 |
4 files changed, 17 insertions, 1 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index b9812f2..548ab4b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -114,7 +114,7 @@ MAP_SRC = emap/atcommand.c \ # need remove -Wno-unused -SHARED_CFLAGS = ${CFLAGS} -O3 -pipe -ffast-math -fvisibility=hidden -std=c99 -Wall -Wextra -Wno-sign-compare -Wno-unused \ +SHARED_CFLAGS = ${CFLAGS} -O3 -pipe -ffast-math -fvisibility=hidden -std=c99 -Wall -Wextra -Wno-sign-compare -Wno-unused -fno-omit-frame-pointer \ -DPCRE_SUPPORT -I../../.. -I../../../../3rdparty -DPACKETVER=20150000 SHARED_LDFLAGS = -avoid-version -Wl,--no-undefined diff --git a/src/emap/init.c b/src/emap/init.c index fb9da26..a355e2b 100644 --- a/src/emap/init.c +++ b/src/emap/init.c @@ -270,6 +270,7 @@ HPExport void plugin_init (void) addHookPost(status, calc_speed, estatus_calc_speed_post); addHookPost(map, addflooritem, emap_addflooritem_post); addHookPost(mob, read_db_mode_sub, emob_read_db_mode_sub_post); + addHookPost(npc, get_viewdata, enpc_get_viewdata_post); addHookPost(skill, check_condition_castend, eskill_check_condition_castend_post); addHookPost(pc, additem, epc_additem_post); addHookPost(pc, isequip, epc_isequip_post); diff --git a/src/emap/npc.c b/src/emap/npc.c index 727ea76..9f7ce36 100644 --- a/src/emap/npc.c +++ b/src/emap/npc.c @@ -254,6 +254,7 @@ int enpc_unload_pre(struct npc_data** ndPtr, { struct npc_data *nd = *ndPtr; nullpo_ret(nd); + aFree(nd->vd); if (nd->subtype == SCRIPT) { if (nd->src_id != 0) @@ -283,3 +284,14 @@ int enpc_unload_pre(struct npc_data** ndPtr, } return 0; } + +struct view_data *enpc_get_viewdata_post(struct view_data *retVal, + int class_ __attribute__ ((unused))) +{ + nullpo_retr(NULL, retVal); + + struct view_data *vd; + CREATE(vd, struct view_data, 1); + memcpy(vd, retVal, sizeof(struct view_data)); + return vd; +} diff --git a/src/emap/npc.h b/src/emap/npc.h index ea6c77f..35d23de 100644 --- a/src/emap/npc.h +++ b/src/emap/npc.h @@ -34,4 +34,7 @@ int enpc_get_var_num(const TBL_NPC *const npc, int enpc_unload_pre(struct npc_data** ndPtr, bool *singlePtr); +struct view_data *enpc_get_viewdata_post(struct view_data *retVal, + int class_); + #endif // EVOL_MAP_NPC |