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

Fix penalizing buy-then-change-production #1996

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

lmoureaux
Copy link
Contributor

When a player buys a unit that cannot be built then switches to building something else, penalize half of the shields that were bought. This changes the previous overjealous behaviour where half the total amount of shields would be lost.

Closes #1915.

Testing done

  • Playing normally works as expected.
  • Added the Unique flag to warriors in classic and started a game. Bought a couple Warriors before I had any, then changed production to Settlers. Half of the shields I had bought disappeared as expected.

When a player buys a unit that cannot be built then switches to
building something else, penalize half of the shields that were bought.
This changes the previous overjealous behaviour where half the total
amount of shields would be lost.

Closes longturn#1915.
@lmoureaux lmoureaux requested a review from jwrober July 8, 2023 20:04
@jwrober
Copy link
Collaborator

jwrober commented Jul 8, 2023

Does this change the network protocol? I'll do a more careful review tomorrow.

@lmoureaux
Copy link
Contributor Author

Yes, but in a backward compatible way (though I realize I didn't test... connecting to a running game should be enough).

Copy link
Collaborator

@jwrober jwrober left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me.

@jwrober jwrober merged commit 76f8524 into longturn:master Jul 12, 2023
18 checks passed
@lmoureaux lmoureaux deleted the bugfix/buy-switch-penalty branch July 12, 2023 20:13
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.

Queued shields are halved for unique units same as changing type
2 participants