Skip to content

Conversation

@stavrosfa
Copy link
Contributor

This PR aims to fix 2 bugs that affect the UI and parts of the gameplay. They were introduced int this PR #833

  1. Fix unit buttons
    (Mostly) Because of the asynchronicity of the units, the unit action buttons would update while a selected unit was idle. So if a warrior just spawned in the capital, and was waiting to do something, an automated worker, or another warrior auto-moving in the background would cause the buttons to switch to that unit, and then, because "technically" we already have a unit selected, they wouldn't switch back to that unit's actions.
    Also the button would flicker for the busy/automated units if there was nothing to move and just pressed the end turn button.

  2. Fix NPE when a terraform doesn't have an improvement
    The second bug, I again introduced with the relevant previous commit, where if there was no improvement on a tile, actions like Clear Forest had broken. A null pointer exception was thrown in the background but gameplay would continue normally.
    This is because I was trying to access the current improvement to open the advisor pop up and ask if the player wants to override the previous improvement, which in this case it was null and not properly checked for.

2. Fix NPE when a terraform doesn't have an improvement
@stavrosfa stavrosfa merged commit 01d75b4 into C7-Game:Development Dec 5, 2025
3 checks passed
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