Skip to content

fix: "Related Cards" does not show "rewinded" cards and show initial card instead#1402

Open
artemovie wants to merge 2 commits intoHearthSim:masterfrom
artemovie:fix-rewind-discover-tracking
Open

fix: "Related Cards" does not show "rewinded" cards and show initial card instead#1402
artemovie wants to merge 2 commits intoHearthSim:masterfrom
artemovie:fix-rewind-discover-tracking

Conversation

@artemovie
Copy link

Issue

  • Tess Greymane "Related Cards" does not show "rewinded" cards at all.
  • Tess Greymane "Related Cards" does not show "rewinded" cards with "Stealth" and "Dormant" keywords

Description:

Part I:

When Rewind re-picks during Discover (e.x. Rogue imbue ability), the game sends a new FULL_ENTITY - Updating for the same entity with a different CardID. The CreationRegex handler only set cardId for new entities, ignoring updates to existing ones. This caused Tess Greymane's related cards tooltip to show the first Discover pick instead of the actual played card.
Also remove the incorrect cantPlayChange handler that was a previous attempt at fixing this issue.

Part II:

After Part I, Rewind-Discovered cards with Stealth or Dormant keywords were still missing from the tooltip (see video). When such a card is played, the game sends SHOW_ENTITY - Updating with a blank CardID. The UpdatingEntityRegex handler unconditionally set latestCardId to that blank value, and since all zone change handlers pass latestCardId as the cardId parameter, the playerPlay call was skipped due to the empty cardId guard in zoneChangeFromHand.

Before:

bug2.mov
bug_stealth.mov

After:

fix_01.mov
fix_2.mov

When Rewind re-picks during Discover, the game sends a new
FULL_ENTITY - Updating for the same entity with a different
CardID. The CreationRegex handler only set cardId for new
entities, ignoring updates to existing ones. This caused
Tess Greymane's related cards tooltip to show the first
Discover pick instead of the actual played card.
Also remove the incorrect cantPlayChange handler that was
a previous attempt at fixing this issue.
game sends SHOW_ENTITY with blank CardID. The UpdatingEntityRegex
handler unconditionally set latestCardId to the blank value, causing
all zone change handlers (which pass latestCardId as cardId) to skip
playerPlay due to the empty cardId guard in zoneChangeFromHand.

- latestCardId getter now treats empty string same as nil, falling
  back to entity.cardId instead of returning blank
- SHOW_ENTITY/CHANGE_ENTITY handler now skips latestCardId update
  when CardID is blank, preserving the previously known value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant