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.
Fixes #5764
Before clicking "Create"
master
pins
label if this change will break existing gamesdocker compose exec rack rubocop -a
docker compose exec rack rake
Implementation Notes
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.