Skip to content

Commit e9c4102

Browse files
committed
[Gear] remove runtime find_spell() calls
1 parent 06c12c8 commit e9c4102

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

engine/action/action.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4850,7 +4850,7 @@ buff_t* action_t::create_debuff( player_t* t )
48504850
{
48514851
std::string name_ = target_debuff->ok() ? target_debuff->name_cstr() : name_str;
48524852
util::tokenize( name_ );
4853-
return make_buff( actor_pair_t( t, player ), name_, target_debuff );
4853+
return make_buff( actor_pair_t( t, player ), name_, target_debuff );
48544854
}
48554855

48564856
// return s_data_reporting if available, otherwise fallback to s_data

engine/player/unique_gear_midnight.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4320,7 +4320,6 @@ void zathek_breath_of_corruption( special_effect_t& effect )
43204320

43214321
new dbc_proc_callback_t( effect.player, effect );
43224322
}
4323-
43244323
} // namespace weapons
43254324

43264325
namespace armors
@@ -4629,7 +4628,6 @@ void venomcursed( special_effect_t& effect )
46294628
new dbc_proc_callback_t( effect.player, effect );
46304629
}
46314630
}
4632-
46334631
} // namespace armors
46344632

46354633
namespace sets
@@ -4902,18 +4900,23 @@ struct lingering_rune_t : public BASE
49024900
double echo_coeff;
49034901
action_t* echo;
49044902

4905-
lingering_rune_t( const special_effect_t& e, std::string_view n, const spell_data_t* s, bool ech, double coef, action_t* d )
4903+
lingering_rune_t( const special_effect_t& e, std::string_view n, const spell_data_t* s, bool ech, double coef,
4904+
action_t* d )
49064905
: BASE( e, n, s ), has_echoes( ech ), echo_coeff( coef ), echo( d )
49074906
{
4907+
if ( has_echoes )
4908+
BASE::target_debuff = e.player->find_spell( 1289063 );
49084909
}
49094910

49104911
buff_t* create_debuff( player_t* t ) override
49114912
{
49124913
auto debuff = buff_t::find( t, "rune_of_echoes_debuff" );
49134914

49144915
if ( !debuff )
4916+
{
49154917
debuff = make_buff<rune_of_echoes_debuff_t>( actor_pair_t( t, BASE::player ), "rune_of_echoes_debuff",
4916-
BASE::player->find_spell( 1289063 ), echo );
4918+
BASE::target_debuff, echo );
4919+
}
49174920

49184921
return debuff;
49194922
}
@@ -4959,6 +4962,8 @@ struct omnium_core_rune_t : public BASE
49594962
has_echoes = find_special_effect( e.player, 1279616 ) != nullptr;
49604963
if ( has_echoes )
49614964
{
4965+
BASE::target_debuff = e.player->find_spell( 1289063 );
4966+
49624967
echo = create_proc_action<BASE>( fmt::format( "{}_echo", n ), e, heal ? 1303071 : 1303048 );
49634968
echo->base_dd_min = echo->base_dd_max = 1.0; // actual value is determined by accumulator
49644969
echo->name_str_reporting = "rune_of_echoes";
@@ -4997,8 +5002,10 @@ struct omnium_core_rune_t : public BASE
49975002
auto debuff = buff_t::find( t, "rune_of_echoes_debuff" );
49985003

49995004
if ( !debuff )
5005+
{
50005006
debuff = make_buff<rune_of_echoes_debuff_t>( actor_pair_t( t, BASE::player ), "rune_of_echoes_debuff",
5001-
BASE::player->find_spell( 1289063 ), echo );
5007+
BASE::target_debuff, echo );
5008+
}
50025009

50035010
return debuff;
50045011
}

0 commit comments

Comments
 (0)