summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-07-09 16:15:29 -0300
committershennetsind <ind@henn.et>2013-07-09 16:15:29 -0300
commitfa2b0593163048cb4bdb9157a1aa500caaee0004 (patch)
treee030da3f2855dbc46dc6976dd5c536f3fe37a367 /src
parent2202ececd2735bb7a2810aee522c2b5f1eaa49bd (diff)
downloadhercules-fa2b0593163048cb4bdb9157a1aa500caaee0004.tar.gz
hercules-fa2b0593163048cb4bdb9157a1aa500caaee0004.tar.bz2
hercules-fa2b0593163048cb4bdb9157a1aa500caaee0004.tar.xz
hercules-fa2b0593163048cb4bdb9157a1aa500caaee0004.zip
Follow up 144a9d0843dfe47e0b58c8857762f58ae70543c8
fixed counter going off if target died while timer was running. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src')
-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]