Skip to content

Commit f3400f7

Browse files
committed
[Cooldown] reset cooldown when recharge multiplier is adjusted to 0
1 parent 7976180 commit f3400f7

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

engine/sim/cooldown.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,15 @@ void cooldown_t::adjust_recharge_multiplier()
150150
double old_multiplier = recharge_multiplier;
151151
assert( action && "Only cooldowns with associated action can have their recharge multiplier adjusted." );
152152
recharge_multiplier = action->recharge_multiplier( *this ) * action->recharge_rate_multiplier( *this );
153-
assert( recharge_multiplier > 0.0 );
153+
154+
if ( recharge_multiplier == 0.0 )
155+
{
156+
// Fully reset the cooldown if recharge multiplier is adjusted to be 0, which typically happens via -100% modify
157+
// recharge time effect
158+
reset( false, -1 );
159+
return;
160+
}
161+
154162
if ( old_multiplier == recharge_multiplier )
155163
{
156164
return;
@@ -161,8 +169,8 @@ void cooldown_t::adjust_recharge_multiplier()
161169

162170
if ( sim.debug )
163171
{
164-
sim.out_debug.print( "{} dynamic cooldown {} adjusted: new_ready={} old_ready={} old_mul={} new_mul={}",
165-
*(action -> player), name(), ready, old_ready, old_multiplier, recharge_multiplier );
172+
sim.print_debug( "{} dynamic cooldown {} adjusted: new_ready={} old_ready={} old_mul={} new_mul={}",
173+
*( action->player ), name(), ready, old_ready, old_multiplier, recharge_multiplier );
166174
}
167175
}
168176

0 commit comments

Comments
 (0)