From f17521208fe49fde8864b721b71df63a3a564f37 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 12 Sep 2020 13:47:01 -0300 Subject: Revert "fix the hooks for npc->unload and mob->spawn_dataset, remove the unused hook for status->change_end_" This reverts commit fc19fdff65ee1561b2b1e30e5bab6906f65d34fa. --- src/emap/init.c | 1 + src/emap/mob.c | 3 +-- src/emap/mob.h | 3 +-- src/emap/npc.c | 3 +-- src/emap/npc.h | 3 +-- src/emap/status.c | 20 ++++++++++++++++++++ src/emap/status.h | 5 +++++ 7 files changed, 30 insertions(+), 8 deletions(-) diff --git a/src/emap/init.c b/src/emap/init.c index 0296a98..c321823 100644 --- a/src/emap/init.c +++ b/src/emap/init.c @@ -408,6 +408,7 @@ HPExport void plugin_init (void) addHookPost(status, calc_def, estatus_calc_def_post); addHookPost(status, calc_fix_aspd, estatus_calc_fix_aspd_post); addHookPost(status, change_start, estatus_change_start_post); + addHookPost(status, change_end_, estatus_change_end__post); addHookPost(map, addflooritem, emap_addflooritem_post); addHookPost(mob, read_db_mode_sub, emob_read_db_mode_sub_post); addHookPost(mob, spawn_dataset, emob_spawn_dataset_post); diff --git a/src/emap/mob.c b/src/emap/mob.c index e51dc94..3391620 100644 --- a/src/emap/mob.c +++ b/src/emap/mob.c @@ -296,8 +296,7 @@ uint32 emob_read_db_mode_sub_post(uint32 retVal, } struct mob_data *emob_spawn_dataset_post(struct mob_data *retVal, - struct spawn_data *data __attribute__ ((unused)), - int npc_id __attribute__ ((unused))) + struct spawn_data *data __attribute__ ((unused))) { /* Disabled in TMW2 if (retVal) diff --git a/src/emap/mob.h b/src/emap/mob.h index 0a76fff..ea0013c 100644 --- a/src/emap/mob.h +++ b/src/emap/mob.h @@ -16,8 +16,7 @@ uint32 emob_read_db_mode_sub_post(uint32 retVal, struct mob_db *entry, struct config_setting_t *t); struct mob_data *emob_spawn_dataset_post(struct mob_data *retVal, - struct spawn_data *data, - int npc_id); + struct spawn_data *data); int emob_dead_pre(struct mob_data **mdPtr, struct block_list **srcPtr, int *typePtr); diff --git a/src/emap/npc.c b/src/emap/npc.c index cf7d72c..5b6d66a 100644 --- a/src/emap/npc.c +++ b/src/emap/npc.c @@ -272,8 +272,7 @@ int enpc_get_var_num(const TBL_NPC *const npc, } int enpc_unload_pre(struct npc_data** ndPtr, - bool *singlePtr __attribute__ ((unused)), - bool *unloadMobsPtr __attribute__ ((unused))) + bool *singlePtr __attribute__ ((unused))) { struct npc_data *nd = *ndPtr; nullpo_ret(nd); diff --git a/src/emap/npc.h b/src/emap/npc.h index 7e6289e..ea6c77f 100644 --- a/src/emap/npc.h +++ b/src/emap/npc.h @@ -32,7 +32,6 @@ int enpc_get_var_num(const TBL_NPC *const npc, const char *var); int enpc_unload_pre(struct npc_data** ndPtr, - bool *singlePtr, - bool *unloadMobsPtr); + bool *singlePtr); #endif // EVOL_MAP_NPC diff --git a/src/emap/status.c b/src/emap/status.c index 6c598a8..2d2a884 100644 --- a/src/emap/status.c +++ b/src/emap/status.c @@ -230,6 +230,26 @@ int estatus_change_start_post(int retVal, return retVal; } +int estatus_change_end__post(int retVal, + struct block_list* bl __attribute__ ((unused)), + enum sc_type type __attribute__ ((unused)), + int tid __attribute__ ((unused)), + const char* file __attribute__ ((unused)), + int line __attribute__ ((unused))) +{ + if (!retVal) + return retVal; + +/* + switch ((esc_type)type) + { + default: + break; + } +*/ + return retVal; +} + void estatus_calc_pc_recover_hp_pre(struct map_session_data **sdPtr __attribute__ ((unused)), struct status_data **bstatusPtr) { diff --git a/src/emap/status.h b/src/emap/status.h index f76c607..4fa5a34 100644 --- a/src/emap/status.h +++ b/src/emap/status.h @@ -37,6 +37,11 @@ int estatus_change_start_post(int retVal, int rate, int val1, int val2, int val3, int val4, int tick, int flag); +int estatus_change_end__post(int retVal, + struct block_list* bl, + enum sc_type type, int tid, + const char* file, int line); + void estatus_calc_pc_recover_hp_pre(struct map_session_data **sdPtr, struct status_data **bstatusPtr); -- cgit v1.2.3-60-g2f50