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/CA and core] fix 1822 tax haven bug #11392

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

michaeljb
Copy link
Collaborator

1822's company_status_str (called by views) was mutating the value of the private company entity, and there was a substraction operation in place to try to copmensate for that, but that caused #11040 by subtracting the tax haven's value for other players.

This has been simplified with the following approach:

  • when displaying the company value, call a new wrapper method in the Game::Base class
  • in 1822, override that new method only for the Tax Haven

Now the Tax Haven private company entity will always have a value of $0/£0, but the value of the Tax Haven "player" entity is handed off to display methods.

Fixes #11040

Before clicking "Create"

  • Branch is derived from the latest master
  • Add the pins or archive_alpha_games 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

1822's `company_status_str` (called by views) was mutating the value of the
private company entity, and there was a substraction operation in place to try
to copmensate for that, but that caused tobymao#11040 by subtracting the tax haven's
value for other players.

This has been simplified with the following approach:

- when displaying the company value, call a new wrapper method in the `Game::Base` class
- in 1822, override that new method only for the Tax Haven

Now the Tax Haven private company entity will always have a value of $0/£0, but the
value of the Tax Haven "player" entity is handed off to display methods.

Fixes tobymao#11040
@michaeljb michaeljb changed the title [1822/core] fix 1822 tax haven bug [1822/CA and core] fix 1822 tax haven bug Dec 1, 2024
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.

[1822] Value of Tax Haven subtracted from different player in Entities view
1 participant