summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-07-26 17:47:07 -0300
committershennetsind <ind@henn.et>2013-07-26 17:47:07 -0300
commit2eab181cece04d8c6a79f9d1a3ff74343cd3ae76 (patch)
tree698cd7504ea1da3a571987384cb0752473ee74c5 /src/map/battle.c
parent21b13ae7ef4747caf52784f4fb753e9a98ff2bd8 (diff)
downloadhercules-2eab181cece04d8c6a79f9d1a3ff74343cd3ae76.tar.gz
hercules-2eab181cece04d8c6a79f9d1a3ff74343cd3ae76.tar.bz2
hercules-2eab181cece04d8c6a79f9d1a3ff74343cd3ae76.tar.xz
hercules-2eab181cece04d8c6a79f9d1a3ff74343cd3ae76.zip
Follow up 144a9d0843dfe47e0b58c8857762f58ae70543c8
It will no longer block the equipping of items, instead it will delay (if applicable) the item's effect until it is no longer capable of affecting the skills under the timer. Special Thanks to kyeme for the information. Signed-off-by: shennetsind <ind@henn.et>
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);