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

[1822] fixes SELL_AFTER rule #9989

Merged
merged 1 commit into from
Dec 9, 2023
Merged

Conversation

philcampeau
Copy link
Collaborator

Fixes #5764

Before clicking "Create"

  • Branch is derived from the latest master
  • Add the pins label if this change will break existing games
  • Code passes linter with docker compose exec rack rubocop -a
  • Tests pass cleanly with docker compose exec rack rake

Implementation Notes

  • Explanation of Change

Currently, the game code allowed a player with a corp in EMR to sell shares of the acting company, even if it were that corp's first OR. However, rule 4.4.1 states "• Shares cannot be sold in a company that has not completed an operating round."

I added a new option for the SELL_AFTER constant, :full_or_turn, that doesn't allow the sale of any shares of a corp until that corp has completed an OR.

The way I did this was to have it first check if we're in an operating round, and if the current entity is the president of the corporation whose shares are being sold. If so, the corporation needs an operating history size greater than 1. Else, corporation.operated? simply needs to be true.

Logically, this should work, but please let me know if I've missed something. If this is correct, there are a few other games which could use this code as well.

Also deleted a fixture file that no longer worked as a result of this change.

@philcampeau philcampeau added pins PR that will require some games to be pinned 1822 1822MX 1822PNW 1822Africa 1822CA labels Dec 7, 2023
@tobymao tobymao merged commit 97e975b into tobymao:master Dec 9, 2023
1 check passed
@philcampeau philcampeau deleted the 1822-EMR-update branch February 7, 2024 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1822Africa 1822CA 1822MX 1822PNW 1822 pins PR that will require some games to be pinned
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[1822] Emergency fundraising permits prohibited sale of shares
2 participants