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

Chushogi: Fix bug with non-lion double movers capturing lion #8

Merged

Conversation

maconard
Copy link

@maconard maconard commented May 27, 2024

Addressing issue: WandererXII/lishogi#830

It was discovered that when a non-Lion double mover captures a Lion on the mid step and then moves to another square (igui or hit and run), the last lion capture square used for counterstrike protection rules was not being set. Several highly skilled/professional players confirmed that this is a bug, and that the eagle/falcon should set this square despite having made the capture with a "Lion move".

My changes here allow for the Lion capture square to be set off of a mid step capture, not just a final square capture.

Specifically:

  • Rename secondCapture to midCapture, which is more correct
  • Process the midCapture first, since it happens before the capture at the final square
  • Allow setting the last lion captured square from the mid step and the final step
  • If a Lion was captured on both squares, due to the adjusted ordering the final square will be the last lion capture

Cheers, and please let me know if anything with my PR needs adjustments (such as changelog/versioning things).

@WandererXII
Copy link
Owner

This looks great. Thanks for taking the time to find the bug and fix it.

@WandererXII WandererXII merged commit 21ad5ab into WandererXII:master May 28, 2024
2 checks passed
@maconard
Copy link
Author

Thanks, I'm glad it looks good! Not sure what your process is for actually publishing the shogiops changes on npm and then updating lishogi for the latest dependency, but thank you for all your work on that end!

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.

2 participants