summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-07-09 15:55:30 -0300
committershennetsind <ind@henn.et>2013-07-09 15:55:30 -0300
commit172315bdc45220bc2edeed57b8e6f6a781c2b640 (patch)
treee030da3f2855dbc46dc6976dd5c536f3fe37a367
parent4db2e5b8da6016812e11abac235f1113a78d60d0 (diff)
downloadhercules-172315bdc45220bc2edeed57b8e6f6a781c2b640.tar.gz
hercules-172315bdc45220bc2edeed57b8e6f6a781c2b640.tar.bz2
hercules-172315bdc45220bc2edeed57b8e6f6a781c2b640.tar.xz
hercules-172315bdc45220bc2edeed57b8e6f6a781c2b640.zip
Follow up 144a9d0843dfe47e0b58c8857762f58ae70543c8
fixed counter going off if target died while timer was running. Signed-off-by: shennetsind <ind@henn.et>
-rw-r--r--src/map/battle.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index d90ba5e0c..0530510c4 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -211,16 +211,19 @@ struct delay_damage {
enum damage_lv dmg_lv;
unsigned short attack_type;
bool additional_effects;
+ enum bl_type src_type;
};
int battle_delay_damage_sub(int tid, unsigned int tick, int id, intptr_t data) {
struct delay_damage *dat = (struct delay_damage *)data;
if ( dat ) {
- struct block_list* src;
+ struct block_list* src = NULL;
struct block_list* target = iMap->id2bl(dat->target_id);
if( !target || iStatus->isdead(target) ) {/* nothing we can do */
+ if( dat->src_type == BL_PC && ( src = iMap->id2bl(dat->src_id) ) )
+ ((TBL_PC*)src)->delayed_damage--;
ers_free(delay_damage_ers, dat);
return 0;
}
@@ -287,6 +290,7 @@ int battle_delay_damage (unsigned int tick, int amotion, struct block_list *src,
dat->delay = ddelay;
dat->distance = distance_bl(src, target)+10; //Attack should connect regardless unless you teleported.
dat->additional_effects = additional_effects;
+ dat->src_type = src->type;
if (src->type != BL_PC && amotion > 1000)
amotion = 1000; //Aegis places a damage-delay cap of 1 sec to non player attacks. [Skotlex]