summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormalufett <malufett.eat.my.binaries@gmail.com>2015-01-12 02:12:55 +0800
committermalufett <malufett.eat.my.binaries@gmail.com>2015-01-12 02:12:55 +0800
commit819bc0c5bb225c51be77e585d5e1c8af00850657 (patch)
treecd1a6b2e6b32a4d0a135edab6190cdb8a6133577 /src
parent670fca4c54445440c25e1114e64170e3934645f1 (diff)
downloadhercules-819bc0c5bb225c51be77e585d5e1c8af00850657.tar.gz
hercules-819bc0c5bb225c51be77e585d5e1c8af00850657.tar.bz2
hercules-819bc0c5bb225c51be77e585d5e1c8af00850657.tar.xz
hercules-819bc0c5bb225c51be77e585d5e1c8af00850657.zip
Fixed Bug where skill timer is not properly terminated/clear when the caster dies.
-Thanks to GM Nihad. Signed-off-by: malufett <malufett.eat.my.binaries@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/map/skill.c10
-rw-r--r--src/map/skill.h2
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc8
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc2
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc29
5 files changed, 26 insertions, 25 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 38b9097cd..db675d7f4 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -3460,9 +3460,8 @@ int skill_cleartimerskill (struct block_list *src)
case SR_SKYNETBLOW:
continue;
default:
- skill->cleartimerskill_unknown(ud->skilltimerskill[i]->skill_id);
- continue;
-
+ if(skill->cleartimerskill_exception(ud->skilltimerskill[i]->skill_id))
+ continue;
}
timer->delete(ud->skilltimerskill[i]->timer, skill->timerskill);
ers_free(skill->timer_ers, ud->skilltimerskill[i]);
@@ -3472,8 +3471,9 @@ int skill_cleartimerskill (struct block_list *src)
return 1;
}
-void skill_cleartimerskill_unknown(int skill_id)
+bool skill_cleartimerskill_exception(int skill_id)
{
+ return false;
}
int skill_activate_reverberation(struct block_list *bl, va_list ap) {
@@ -19318,7 +19318,7 @@ void skill_defaults(void) {
skill->timerskill_dead_unknown = skill_timerskill_dead_unknown;
skill->timerskill_target_unknown = skill_timerskill_target_unknown;
skill->timerskill_notarget_unknown = skill_timerskill_notarget_unknown;
- skill->cleartimerskill_unknown = skill_cleartimerskill_unknown;
+ skill->cleartimerskill_exception = skill_cleartimerskill_exception;
skill->castend_damage_id_unknown = skill_castend_damage_id_unknown;
skill->castend_id_unknown = skill_castend_id_unknown;
skill->castend_nodamage_id_dead_unknown = skill_castend_nodamage_id_dead_unknown;
diff --git a/src/map/skill.h b/src/map/skill.h
index fa88bce99..6cb43405f 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -2056,7 +2056,7 @@ struct skill_interface {
bool (*timerskill_dead_unknown) (struct block_list *src, struct unit_data *ud, struct skill_timerskill *skl);
void (*timerskill_target_unknown) (int tid, int64 tick, struct block_list *src, struct block_list *target, struct unit_data *ud, struct skill_timerskill *skl);
void (*timerskill_notarget_unknown) (int tid, int64 tick, struct block_list *src, struct block_list *target, struct unit_data *ud, struct skill_timerskill *skl);
- void (*cleartimerskill_unknown) (int skill_id);
+ bool (*cleartimerskill_exception) (int skill_id);
bool (*castend_id_unknown) (struct unit_data *ud, struct block_list *src, struct block_list *target);
bool (*castend_nodamage_id_dead_unknown) (struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
bool (*castend_nodamage_id_undead_unknown) (struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index 06a046812..ec90fb1b6 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -4747,8 +4747,8 @@ struct {
struct HPMHookPoint *HP_skill_timerskill_target_unknown_post;
struct HPMHookPoint *HP_skill_timerskill_notarget_unknown_pre;
struct HPMHookPoint *HP_skill_timerskill_notarget_unknown_post;
- struct HPMHookPoint *HP_skill_cleartimerskill_unknown_pre;
- struct HPMHookPoint *HP_skill_cleartimerskill_unknown_post;
+ struct HPMHookPoint *HP_skill_cleartimerskill_exception_pre;
+ struct HPMHookPoint *HP_skill_cleartimerskill_exception_post;
struct HPMHookPoint *HP_skill_castend_id_unknown_pre;
struct HPMHookPoint *HP_skill_castend_id_unknown_post;
struct HPMHookPoint *HP_skill_castend_nodamage_id_dead_unknown_pre;
@@ -9906,8 +9906,8 @@ struct {
int HP_skill_timerskill_target_unknown_post;
int HP_skill_timerskill_notarget_unknown_pre;
int HP_skill_timerskill_notarget_unknown_post;
- int HP_skill_cleartimerskill_unknown_pre;
- int HP_skill_cleartimerskill_unknown_post;
+ int HP_skill_cleartimerskill_exception_pre;
+ int HP_skill_cleartimerskill_exception_post;
int HP_skill_castend_id_unknown_pre;
int HP_skill_castend_id_unknown_post;
int HP_skill_castend_nodamage_id_dead_unknown_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index 7c09737fa..9442e5b20 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -2409,7 +2409,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(skill->timerskill_dead_unknown, HP_skill_timerskill_dead_unknown) },
{ HP_POP(skill->timerskill_target_unknown, HP_skill_timerskill_target_unknown) },
{ HP_POP(skill->timerskill_notarget_unknown, HP_skill_timerskill_notarget_unknown) },
- { HP_POP(skill->cleartimerskill_unknown, HP_skill_cleartimerskill_unknown) },
+ { HP_POP(skill->cleartimerskill_exception, HP_skill_cleartimerskill_exception) },
{ HP_POP(skill->castend_id_unknown, HP_skill_castend_id_unknown) },
{ HP_POP(skill->castend_nodamage_id_dead_unknown, HP_skill_castend_nodamage_id_dead_unknown) },
{ HP_POP(skill->castend_nodamage_id_undead_unknown, HP_skill_castend_nodamage_id_undead_unknown) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index 9efaa6718..e4e87abb9 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -63837,31 +63837,32 @@ void HP_skill_timerskill_notarget_unknown(int tid, int64 tick, struct block_list
}
return;
}
-void HP_skill_cleartimerskill_unknown(int skill_id) {
+bool HP_skill_cleartimerskill_exception(int skill_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_cleartimerskill_unknown_pre ) {
- void (*preHookFunc) (int *skill_id);
+ bool retVal___ = false;
+ if( HPMHooks.count.HP_skill_cleartimerskill_exception_pre ) {
+ bool (*preHookFunc) (int *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_cleartimerskill_unknown_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_skill_cleartimerskill_unknown_pre[hIndex].func;
- preHookFunc(&skill_id);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_cleartimerskill_exception_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_skill_cleartimerskill_exception_pre[hIndex].func;
+ retVal___ = preHookFunc(&skill_id);
}
if( *HPMforce_return ) {
*HPMforce_return = false;
- return;
+ return retVal___;
}
}
{
- HPMHooks.source.skill.cleartimerskill_unknown(skill_id);
+ retVal___ = HPMHooks.source.skill.cleartimerskill_exception(skill_id);
}
- if( HPMHooks.count.HP_skill_cleartimerskill_unknown_post ) {
- void (*postHookFunc) (int *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_cleartimerskill_unknown_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_skill_cleartimerskill_unknown_post[hIndex].func;
- postHookFunc(&skill_id);
+ if( HPMHooks.count.HP_skill_cleartimerskill_exception_post ) {
+ bool (*postHookFunc) (bool retVal___, int *skill_id);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_cleartimerskill_exception_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_skill_cleartimerskill_exception_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, &skill_id);
}
}
- return;
+ return retVal___;
}
bool HP_skill_castend_id_unknown(struct unit_data *ud, struct block_list *src, struct block_list *target) {
int hIndex = 0;