fix: "Related Cards" does not show "rewinded" cards and show initial card instead#1402
Open
artemovie wants to merge 2 commits intoHearthSim:masterfrom
Open
fix: "Related Cards" does not show "rewinded" cards and show initial card instead#1402artemovie wants to merge 2 commits intoHearthSim:masterfrom
artemovie wants to merge 2 commits intoHearthSim:masterfrom
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
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. TheCreationRegexhandler 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
cantPlayChangehandler 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. TheUpdatingEntityRegexhandler unconditionally setlatestCardIdto that blank value, and since all zone change handlers passlatestCardIdas thecardIdparameter, theplayerPlaycall was skipped due to the emptycardIdguard inzoneChangeFromHand.Before:
bug2.mov
bug_stealth.mov
After:
fix_01.mov
fix_2.mov