From 858ef4f4c62a59336e1b3cbb96d9a82393d05c44 Mon Sep 17 00:00:00 2001 From: Kate Martin <51387586+renanthera@users.noreply.github.com> Date: Sun, 8 Jun 2025 04:58:19 -0600 Subject: [PATCH 1/2] [player] Deduplicate expressions that resolve identically. --- engine/player/player.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/engine/player/player.cpp b/engine/player/player.cpp index 1d64dd39681..0e4e131c322 100644 --- a/engine/player/player.cpp +++ b/engine/player/player.cpp @@ -3515,6 +3515,8 @@ parsed_assisted_combat_rule_t player_t::parse_assisted_combat_rule( const assist std::string expr_str_2; std::string expr_str_3; bool has_or; + bool is_duplicate_2; + bool is_duplicate_3; // TODO: verify < vs <= and > vs >= on all condition types switch ( rule.condition_type ) { @@ -3563,13 +3565,15 @@ parsed_assisted_combat_rule_t player_t::parse_assisted_combat_rule( const assist expr_str = v1 ? aura_expr_from_spell_id( v1, true ) : ""; expr_str_2 = v2 ? aura_expr_from_spell_id( v2, true ) : ""; expr_str_3 = v3 ? aura_expr_from_spell_id( v3, true ) : ""; - if ( v1 && !expr_str.find( "talent." ) == 0 ) + if ( v1 && !( expr_str.find( "talent." ) == 0 ) ) expr_str += ".up"; - if ( v2 && !expr_str_2.find( "talent." ) == 0 ) + if ( v2 && !( expr_str_2.find( "talent." ) == 0 ) ) expr_str_2 += ".up"; - if ( v3 && !expr_str_3.find( "talent." ) == 0 ) + if ( v3 && !( expr_str_3.find( "talent." ) == 0 ) ) expr_str_3 += ".up"; - if ( v2 ) + is_duplicate_2 = v2 && expr_str_2 == expr_str; + is_duplicate_3 = v3 && ( expr_str_3 == expr_str || expr_str_3 == expr_str_2 ); + if ( v2 && !is_duplicate_2 ) { if ( !expr_str.empty() ) { @@ -3578,7 +3582,7 @@ parsed_assisted_combat_rule_t player_t::parse_assisted_combat_rule( const assist } expr_str += expr_str_2; } - if ( v3 ) + if ( v3 && !is_duplicate_3 ) { if ( !expr_str.empty() ) { From c6502ad48a6ea4af11b30616dd1e86c81dc28b1a Mon Sep 17 00:00:00 2001 From: Kate Martin <51387586+renanthera@users.noreply.github.com> Date: Sun, 8 Jun 2025 05:34:44 -0600 Subject: [PATCH 2/2] [player] Show diff comment if deduplication occurs. --- engine/player/player.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/engine/player/player.cpp b/engine/player/player.cpp index 0e4e131c322..5a84a8c31da 100644 --- a/engine/player/player.cpp +++ b/engine/player/player.cpp @@ -3517,6 +3517,7 @@ parsed_assisted_combat_rule_t player_t::parse_assisted_combat_rule( const assist bool has_or; bool is_duplicate_2; bool is_duplicate_3; + bool is_modified; // TODO: verify < vs <= and > vs >= on all condition types switch ( rule.condition_type ) { @@ -3591,9 +3592,10 @@ parsed_assisted_combat_rule_t player_t::parse_assisted_combat_rule( const assist } expr_str += expr_str_3; } + is_modified = is_duplicate_2 || is_duplicate_3; if ( has_or ) - return fmt::format( "({})", expr_str ); - return expr_str; + return { fmt::format( "({})", expr_str ), is_modified }; + return { expr_str, is_modified }; case AURA_ON_TARGET: assert( v2 == 0 && v3 == 0 ); expr_str = aura_expr_from_spell_id( v1, false );