Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TargetCardInHand can't choose from another player hand and freeze the game #6210

Open
3 tasks
JayDi85 opened this issue Jan 21, 2020 · 0 comments
Open
3 tasks
Assignees
Labels
bug Bugs and errors refactoring Developers topics about code and programming

Comments

@JayDi85
Copy link
Member

JayDi85 commented Jan 21, 2020

If you need to choose card from another player's hand then do not call TargetCardInHand -- it can choose cards from chooser hand only, not from any other hands (see related bug example: #6209). As workaround: replace it with TargetCard.

Smell/broken code -- different players in choose and chooseTarget line:
shot_200121_053751
shot_200121_063444

Also it can freeze the game with empty cards to select (fixed by a072d82)

Cards to check: search by regexp choose.+\.getHand\(\)

TODO:

  • search, check and fix cards by choose.+\.getHand\(\) (~80 cards to check, if it use different players then replace by TargetCard);

Maybe TODO:

  • rename TargetCardInHand to TargetCardInSourceHand (current implementation);
  • add TargetCardInPlayerHand(UUID playerId...
@JayDi85 JayDi85 added bug Bugs and errors refactoring Developers topics about code and programming labels Jan 21, 2020
@jeffwadsworth jeffwadsworth self-assigned this Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs and errors refactoring Developers topics about code and programming
Projects
None yet
Development

No branches or pull requests

2 participants