Skip to content

[Player] fix default potion expressions#11461

Open
Harmenszoon wants to merge 1 commit into
simulationcraft:midnightfrom
Harmenszoon:codex/fix-default-potion-expression
Open

[Player] fix default potion expressions#11461
Harmenszoon wants to merge 1 commit into
simulationcraft:midnightfrom
Harmenszoon:codex/fix-default-potion-expression

Conversation

@Harmenszoon
Copy link
Copy Markdown
Contributor

Summary

  • Fix potion.<name> expressions so they use a player's class default potion when potion= is not explicitly set.
  • Keep the generated default potion string alive while comparing through std::string_view.

Cause

player_t::create_expression() only consulted default_potion() when the default was empty, so common expressions such as potion.lights_potential_2 returned false for profiles relying on class defaults. The same code path also assigned a temporary std::string return value into a std::string_view.

Validation

  • Rebuilt build-codex\simc.exe with MSVC/CMake.
  • Minimal Beast Mastery Hunter repro, no explicit potion:
    • Before: actions=potion,if=potion.lights_potential_2 did not show lights_potential.
    • After: default and explicit potion=lights_potential_2 runs both show lights_potential and TotalEvents=59 with threads=1 target_error=0 deterministic=1 seed=12345.
  • Negative control: actions=potion,if=potion.tempered_potion_3 remains false and does not show the potion buff.
  • Suffix alias control: actions=potion,if=potion.lights_potential still reaches the suffix-stripping path and shows the potion buff.
  • profiles/CI.simc iterations=10 cleanup_threads=1 output=NUL exits 0. Existing baseline warnings about Frostbane, Static Charge, Fury default talents, and runeforges remain unchanged.

Generated files

None.

Default potion expressions only checked class defaults when the default string was empty, so potion.<default> stayed false unless a profile explicitly set potion=. Store the generated default string before viewing it and use the same non-empty default behavior as consumable selection.

Validated with a Beast Mastery Hunter minimal action list for default, explicit, alias, and wrong-potion expressions; also ran profiles/CI.simc iterations=10 cleanup_threads=1 output=NUL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant