Skip to content

[Buff] Parse buff_refresh_behavior::TICK #10341

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: thewarwithin
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions engine/buff/buff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,9 @@ buff_t* buff_t::set_period( timespan_t period )
// Recheck tick behaviour, which is dependent on buff_period.
set_tick_behavior( tick_behavior );

// Tick behavior can affect refresh behavior, recheck refresh behavior once tick behavior has been set
set_refresh_behavior( buff_refresh_behavior::NONE );

return this;
}

Expand Down Expand Up @@ -1311,9 +1314,13 @@ buff_t* buff_t::set_refresh_behavior( buff_refresh_behavior b )
if ( b == buff_refresh_behavior::NONE )
{
// In wod, default behavior for ticking buffs is to pandemic-extend the duration
if ( tick_behavior == buff_tick_behavior::CLIP || tick_behavior == buff_tick_behavior::REFRESH )
if ( buff_period > timespan_t::zero() &&
( tick_behavior == buff_tick_behavior::CLIP || tick_behavior == buff_tick_behavior::REFRESH ) )
{
refresh_behavior = buff_refresh_behavior::PANDEMIC;
if ( data().flags( spell_attribute::SX_REFRESH_EXTENDS_DURATION ) )
refresh_behavior = buff_refresh_behavior::PANDEMIC;
else
refresh_behavior = buff_refresh_behavior::TICK;
}
// Otherwise, just do the full-duration refresh
else
Expand Down
Loading