Skip to content

Commit ebedc5b

Browse files
committed
[player] Include base/overridden rules in comment. Revert if undesired, would need to be added to the DK override for that module to gain this feature.
1 parent 0c0fea1 commit ebedc5b

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

engine/player/player.cpp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3457,24 +3457,33 @@ std::string player_t::aura_expr_from_spell_id( unsigned int spell_id, bool on_se
34573457

34583458
void player_t::parse_assisted_combat_step( const assisted_combat_step_data_t& step, action_priority_list_t* assisted_combat )
34593459
{
3460-
std::string options = "";
3460+
std::string expr = "";
3461+
std::string base_expr = "";
34613462
std::string comment = "";
34623463
for ( const auto& rule : assisted_combat_rule_data_t::data( step.id, is_ptr() ) )
34633464
{
3464-
parsed_assisted_combat_rule_t rule_str = parse_assisted_combat_rule( rule, step );
3465-
if ( !rule_str.expr.empty() )
3466-
options += options.empty() ? rule_str.expr : "&" + rule_str.expr;
3467-
if ( !rule_str.comment.empty() )
3468-
comment += comment.empty() ? rule_str.comment : ", " + rule_str.comment;
3465+
parsed_assisted_combat_rule_t derived_combat_rule = parse_assisted_combat_rule( rule, step );
3466+
parsed_assisted_combat_rule_t base_combat_rule = player_t::parse_assisted_combat_rule( rule, step );
3467+
3468+
if ( !derived_combat_rule.expr.empty() )
3469+
expr += expr.empty() ? derived_combat_rule.expr : "&" + derived_combat_rule.expr;
3470+
if ( !derived_combat_rule.comment.empty() )
3471+
comment += comment.empty() ? derived_combat_rule.comment : ", " + derived_combat_rule.comment;
3472+
if ( !base_combat_rule.expr.empty() )
3473+
base_expr += base_expr.empty() ? base_combat_rule.expr : "&" + base_combat_rule.expr;
34693474
}
3475+
3476+
if ( base_expr != expr )
3477+
comment += comment.empty() ? fmt::format( "({} -> {})", base_expr, expr ) : fmt::format( " ({} -> {})", base_expr, expr );
3478+
34703479
for ( const auto& name : action_names_from_spell_id( step.spell_id ) )
34713480
{
34723481
if ( !name.empty() )
34733482
{
3474-
if ( options.empty() )
3483+
if ( expr.empty() )
34753484
assisted_combat->add_action( name, comment );
34763485
else
3477-
assisted_combat->add_action( name + ",if=" + options, comment );
3486+
assisted_combat->add_action( name + ",if=" + expr, comment );
34783487
}
34793488
}
34803489
}

0 commit comments

Comments
 (0)