Skip to content

Commit

Permalink
[Druid] assert on druid buffs checked on non-druid actions
Browse files Browse the repository at this point in the history
  • Loading branch information
gastank committed Aug 30, 2024
1 parent 14c1796 commit 47ed4da
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions engine/class_modules/sc_druid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1650,6 +1650,8 @@ struct druid_buff_base_t : public Base

bool can_trigger( action_t* a ) const override
{
assert( dynamic_cast<druid_action_data_t*>( a ) && "Non Druid action passed to Druid buff can_trigger." );

if ( Base::is_fallback || !a->data().ok() || !Base::get_trigger_data()->ok() )
return false;

Expand All @@ -1668,15 +1670,13 @@ struct druid_buff_base_t : public Base
}

// allow if the action is from convoke and the driver procs from cast successful
if ( Base::get_trigger_data()->proc_flags() & PF_CAST_SUCCESSFUL )
if ( ( Base::get_trigger_data()->proc_flags() & PF_CAST_SUCCESSFUL ) &&
dynamic_cast<druid_action_data_t*>( a )->has_flag( flag_e::CONVOKE ) )
{
if ( auto tmp = dynamic_cast<druid_action_data_t*>( a ); tmp && tmp->has_flag( flag_e::CONVOKE ) )
{
return true;
}
return true;
}

// by default procs cannot proc other procs
// by default procs cannot trigger
return false;
}

Expand All @@ -1685,35 +1685,35 @@ struct druid_buff_base_t : public Base

bool can_expire( action_t* a ) const override
{
assert( dynamic_cast<druid_action_data_t*>( a ) && "Non Druid action passed to Druid buff can_expire." );

if ( Base::is_fallback || !a->data().ok() || !Base::data().ok() )
return false;

if ( Base::data().flags( spell_attribute::SX_ONLY_PROC_FROM_CLASS_ABILITIES ) && !a->allow_class_ability_procs )
return false;

bool ret = true;

if ( a->proc )
{
// allow if either the buff or the driver can proc from procs
if ( Base::data().flags( spell_attribute::SX_CAN_PROC_FROM_PROCS ) ||
Base::get_trigger_data()->flags( spell_attribute::SX_CAN_PROC_FROM_PROCS ) )
{
ret = true;
return true;
}

// allow if the action is from convoke and the buff procs from cast successful
else if ( auto tmp = dynamic_cast<druid_action_data_t*>( a );
tmp && tmp->has_flag( flag_e::CONVOKE ) && Base::data().proc_flags() & PF_CAST_SUCCESSFUL )
if ( ( Base::data().proc_flags() & PF_CAST_SUCCESSFUL ) &&
dynamic_cast<druid_action_data_t*>( a )->has_flag( flag_e::CONVOKE ) )
{
ret = true;
}
else
{
ret = false;
return true;
}

// by default procs cannot expire
return false;
}

return ret;
return true;
}
};

Expand Down

0 comments on commit 47ed4da

Please sign in to comment.