Skip to content

Commit f869fa7

Browse files
committed
[Player] remove unnecessary range checks in assisted combat rotations
1 parent 41e2fd7 commit f869fa7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

engine/player/player.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3484,7 +3484,7 @@ std::string player_t::parse_assisted_combat_rule( const assisted_combat_rule_dat
34843484
{
34853485
const spell_data_t* spell = find_spell( spell_id );
34863486
if ( !spell )
3487-
throw std::runtime_error( fmt::format( "Unable to find spell '{}' for assisted combat condition ' '.", spell_id, rule.id ) );
3487+
throw std::runtime_error( fmt::format( "Unable to find spell '{}' for assisted combat condition '{}'.", spell_id, rule.id ) );
34883488
std::string spell_name = util::tokenize_fn( spell->name_cstr() );
34893489
if ( spell_name.empty() )
34903490
return fmt::format( "unknown_spell_{}", spell_id );
@@ -3511,17 +3511,17 @@ std::string player_t::parse_assisted_combat_rule( const assisted_combat_rule_dat
35113511
// TODO: Are there any other types of passives to check here?
35123512
// TODO: What happens when Blizzard uses an aura here like they did with Mind Flay: Insanity?
35133513
}
3514-
return "";
3514+
return ""; // no check necessary because simc actions are filtered out of the spell is not known
35153515
case SPELL_ON_COOLDOWN:
35163516
assert( v2 == 0 && v3 == 0 );
35173517
if ( v1 )
35183518
return fmt::format( "!cooldown.{}.ready", tokenize_spell( v1 ) );
3519-
return "";
3519+
return ""; // no check necessary because simc actions are not ready unless their cooldown is ready
35203520
case SPELL_OFF_COOLDOWN:
35213521
assert( v2 == 0 && v3 == 0 );
35223522
if ( v1 )
35233523
return fmt::format( "cooldown.{}.ready", tokenize_spell( v1 ) );
3524-
return "";
3524+
return ""; // no check necessary because simc actions are not ready unless their cooldown is ready
35253525
case TARGET_DISTANCE_LESS:
35263526
assert( v2 == 0 && v3 == 0 );
35273527
return fmt::format( "target.distance<{}", v1 );
@@ -3572,7 +3572,7 @@ std::string player_t::parse_assisted_combat_rule( const assisted_combat_rule_dat
35723572
if ( v1 )
35733573
// TODO: implement this expression
35743574
return fmt::format( "action.{}.cost_affordable", tokenize_spell( v1 ) );
3575-
return "";
3575+
return ""; // no check necessary because simc actions are not ready unless their cost is affordable
35763576
case AURA_MISSING_TARGET:
35773577
assert( v2 == 0 && v3 == 0 );
35783578
expr_str = aura_expr_from_spell_id( v1, false );
@@ -3722,7 +3722,7 @@ std::string player_t::parse_assisted_combat_rule( const assisted_combat_rule_dat
37223722
assert( v2 == 0 && v3 == 0 );
37233723
if ( v1 )
37243724
return fmt::format( "spell_targets.{}>0", tokenize_spell( v1 ) );
3725-
return "spell_targets>0";
3725+
return ""; // no check necessary because simc actions are not ready unless they have a target
37263726
case HAS_PET:
37273727
assert( v1 == 0 && v2 == 0 && v3 == 0 );
37283728
return "pet.any.active";

0 commit comments

Comments
 (0)