summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 2fca9ef9c..c1f568843 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -222,8 +222,10 @@ int battle_delay_damage_sub(int tid, unsigned int tick, int id, intptr_t data) {
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--;
+ if( dat->src_type == BL_PC && ( src = iMap->id2bl(dat->src_id) ) && --((TBL_PC*)src)->delayed_damage == 0 && ((TBL_PC*)src)->state.hold_recalc ) {
+ ((TBL_PC*)src)->state.hold_recalc = 0;
+ status_calc_pc(((TBL_PC*)src),0);
+ }
ers_free(delay_damage_ers, dat);
return 0;
}
@@ -250,8 +252,10 @@ int battle_delay_damage_sub(int tid, unsigned int tick, int id, intptr_t data) {
iMap->freeblock_unlock();
}
- if( src && src->type == BL_PC )
- ((TBL_PC*)src)->delayed_damage--;
+ if( src && src->type == BL_PC && --((TBL_PC*)src)->delayed_damage == 0 && ((TBL_PC*)src)->state.hold_recalc ) {
+ ((TBL_PC*)src)->state.hold_recalc = 0;
+ status_calc_pc(((TBL_PC*)src),0);
+ }
}
ers_free(delay_damage_ers, dat);
return 0;
@@ -294,8 +298,9 @@ int battle_delay_damage (unsigned int tick, int amotion, struct block_list *src,
if (src->type != BL_PC && amotion > 1000)
amotion = 1000; //Aegis places a damage-delay cap of 1 sec to non player attacks. [Skotlex]
- if( src->type == BL_PC )
+ if( src->type == BL_PC ) {
((TBL_PC*)src)->delayed_damage++;
+ }
iTimer->add_timer(tick+amotion, battle->delay_damage_sub, 0, (intptr_t)dat);