Skip to content

Engine messages not going through - #980

Merged
stavrosfa merged 1 commit into
C7-Game:Developmentfrom
stavrosfa:fix/stop-selecting-units-on-turn-end
Aug 3, 2026
Merged

Engine messages not going through#980
stavrosfa merged 1 commit into
C7-Game:Developmentfrom
stavrosfa:fix/stop-selecting-units-on-turn-end

Conversation

@stavrosfa

@stavrosfa stavrosfa commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

This PR fixes a bug where, if you load a game where there are no more selectable (not busy) units, and you try for example to update the Domestic advisors' slider values ( I noticed the bug while working on #979), this will either lag a lot, or simply not go through at all.

I am not 100% sure why this is happening when a game is loaded like that, but not when we are in game and have no more selectable units, but I could see the engine sending a lot of MsgPerformUnitAction messages when the player is expected to simply end their turn.

So the main fix is to exit early from the UnitSelector's process when the blinker signal has been emitted.

If you want to reproduce it, load a game (I tried .SAV) where you have finished you turn and the blinker is on, and try to update the Domestic advisor's slider values.

Another thing I noticed was that we update the citizens' moods back to back, one in the MsgChangeSliders after updating the values, and then right after we send a new MsgUpdateUiAfterDomesticChange message wihch does the exact same thing and seems redundant, so I removed it.

Remove back to back calculation of citizen moods.

@ajhalme ajhalme left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems reasonable.

Maybe some of the animation stuff isn't getting loaded up right for "busy" units, like the worker digging a hole animation.

@stavrosfa

Copy link
Copy Markdown
Contributor Author

Maybe some of the animation stuff isn't getting loaded up right for "busy" units

The animations have been like this for a very long time. It's an initialization issue, not how (or if) the animation is loaded. Have you noticed any animations missing or something?

like the worker digging a hole animation.

You mean the mining animation?! 😅

@stavrosfa
stavrosfa merged commit 3216e08 into C7-Game:Development Aug 3, 2026
5 of 6 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