Fix dealer win game ending logic in all last scenarios#6
Merged
dev-soragoto merged 2 commits intoAug 4, 2025
Merged
Conversation
Co-authored-by: dev-soragoto <43477078+dev-soragoto@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] 查看这个仓库的置顶issue 帮我修改已知问题
Fix known issues: draw penalty display inconsistency and dealer win game ending logic
Aug 4, 2025
dev-soragoto
reviewed
Aug 4, 2025
Owner
|
起码看着不会炸 合一下看看 |
Contributor
Author
... 你说得对,这个更改在功能上是等价的,并没有实际意义。原来的 |
Copilot
AI
changed the title
Fix known issues: draw penalty display inconsistency and dealer win game ending logic
Fix dealer win game ending logic in all last scenarios
Aug 4, 2025
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.
This PR fixes a critical issue where the game doesn't end properly when the dealer (oya) is in 1st place during all last and wins.
Problem
When the dealer wins during all last while in 1st place, the game sometimes doesn't end as expected due to a logic error in the
checkGameOverfunction.Root Cause
In the
checkGameOverfunction, line 793 accessedgameStore.getPlayer(winState.winner)without checking ifwinState.winnerwas empty or undefined. WhenwinState.winneris empty (which can happen after draws or in certain game states), this causes the dealer detection logic to fail, preventing proper game ending detection.Fix
Added proper validation before accessing
winState.winner:Testing
This minimal change addresses the core logic issue while preserving all existing functionality, ensuring correct game ending detection when the dealer wins in all last scenarios.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.