Skip to content

Commit c385d0b

Browse files
committed
[Callbacks] check combat state of player instead of target
1 parent b3378ab commit c385d0b

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

engine/action/action_callback.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ action_callback_t::action_callback_t( player_t* l )
7474
l->callbacks.all_callbacks.push_back( this );
7575
}
7676

77-
void action_callback_t::trigger( const std::vector<action_callback_t*>& v, const proc_data_t& data, player_t* target,
78-
action_state_t* state, proc_trigger_type_e type )
77+
void action_callback_t::trigger( const std::vector<action_callback_t*>& v, const proc_data_t& data, player_t* player,
78+
player_t* target, action_state_t* state, proc_trigger_type_e type )
7979
{
80-
if ( !target->in_combat )
80+
if ( !player->in_combat )
8181
return;
8282

8383
for ( auto cb : v )

engine/action/action_callback.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ struct action_callback_t : private noncopyable
6363
virtual void activate() { active = true; }
6464
virtual void deactivate() { active = false; }
6565

66-
static void trigger( const std::vector<action_callback_t*>& v, const proc_data_t& data, player_t* target,
67-
action_state_t* state, proc_trigger_type_e type );
66+
static void trigger( const std::vector<action_callback_t*>& v, const proc_data_t& data, player_t* player,
67+
player_t* target, action_state_t* state, proc_trigger_type_e type );
6868

6969
static void reset( const std::vector<action_callback_t*>& v );
7070
};

engine/player/pet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ void pet_t::trigger_callbacks( proc_types pt, proc_types2 pt2, action_t* action,
368368
// currently only works for pets and guardians.
369369
if ( type == PLAYER_GUARDIAN || type == PLAYER_PET )
370370
{
371-
action_callback_t::trigger( owner->callbacks.pet_procs[ pt ][ pt2 ], action->proc_data, state->target, state,
371+
action_callback_t::trigger( owner->callbacks.pet_procs[ pt ][ pt2 ], action->proc_data, this, state->target, state,
372372
pt_type );
373373
}
374374
}

engine/player/player.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8857,20 +8857,20 @@ void player_t::trigger_callbacks( proc_types pt, proc_types2 pt2, action_t* acti
88578857
proc_trigger_type_e pt_type )
88588858
{
88598859
assert( action && state && state->target );
8860-
action_callback_t::trigger( callbacks.procs[ pt ][ pt2 ], action->proc_data, state->target, state, pt_type );
8860+
action_callback_t::trigger( callbacks.procs[ pt ][ pt2 ], action->proc_data, this, state->target, state, pt_type );
88618861
}
88628862

88638863
void player_t::trigger_callbacks( proc_types pt, proc_types2 pt2, buff_t* buff, proc_trigger_type_e pt_type )
88648864
{
88658865
assert( buff && buff->player );
8866-
action_callback_t::trigger( callbacks.procs[ pt ][ pt2 ], buff->proc_data, buff->player, nullptr, pt_type );
8866+
action_callback_t::trigger( callbacks.procs[ pt ][ pt2 ], buff->proc_data, this, buff->player, nullptr, pt_type );
88678867
}
88688868

88698869
void player_t::trigger_callbacks( proc_types pt, proc_types2 pt2, const proc_data_t& data, player_t* t,
88708870
proc_trigger_type_e pt_type )
88718871
{
88728872
assert( t );
8873-
action_callback_t::trigger( callbacks.procs[ pt ][ pt2 ], data, t, nullptr, pt_type );
8873+
action_callback_t::trigger( callbacks.procs[ pt ][ pt2 ], data, this, t, nullptr, pt_type );
88748874
}
88758875

88768876
void player_t::trigger_aura_applied_callbacks( const proc_data_t& data, player_t* t )

0 commit comments

Comments
 (0)