Skip to content

Conversation

@stephanmeesters
Copy link

@stephanmeesters stephanmeesters commented Dec 16, 2025

This bugfix solves #1922 and possibly solves #1999

Introduced with #1369 was a mouse capture state that would update when you paused the game however it did not reset this capture state regarding pausing when GameLogic:reset() was called.

Tested with Zero Hour. I could not test it in Generals because a bug see #2001

@stephanmeesters stephanmeesters force-pushed the bugfix-camera-scroll-savegame branch from d92da0d to 513cdf8 Compare December 16, 2025 19:13

m_rankPointsToAddAtGameStart = 0;

TheMouse->onGamePaused(FALSE);
Copy link

Choose a reason for hiding this comment

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

The observation makes sense.

The implementation is not optimal. It will be better to replace

	m_pauseFrame = 0;
	m_gamePaused = FALSE;
	m_pauseSound = FALSE;
	m_pauseMusic = FALSE;
	m_pauseInput = FALSE;
	m_inputEnabledMemory = TRUE;
	m_mouseVisibleMemory = TRUE;
	m_logicTimeScaleEnabledMemory = FALSE;

with

	setGamePaused(FALSE);
	m_pauseFrame = 0;
	m_inputEnabledMemory = TRUE;
	m_mouseVisibleMemory = TRUE;
	m_logicTimeScaleEnabledMemory = FALSE;

higher up in this function and probably also in the init function.

This way other events can also properly update on pause state change.

Not sure if

	m_inputEnabledMemory = TRUE;
	m_mouseVisibleMemory = TRUE;
	m_logicTimeScaleEnabledMemory = FALSE;

still need to be reset then. I suspect it does not matter, but not sure.

Copy link
Author

@stephanmeesters stephanmeesters Dec 17, 2025

Choose a reason for hiding this comment

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

I've made the requested changes and moved the memory resets above the setGamePaused(FALSE) so that things like TheMouse->setVisibility are updated as expected

Mouse edge scroll behavior, music and sound effects and mouse appear fine after the change. I do now notice a very short audio music glitch when loading the savegame probably (confirmed) because we're now calling TheAudio->resumeAudio(AudioAffect_Music) in reset()

@xezon xezon added Bug Something is not working right, typically is user facing Minor Severity: Minor < Major < Critical < Blocker ThisProject The issue was introduced by this project, or this task is specific to this project labels Dec 16, 2025
@stephanmeesters stephanmeesters force-pushed the bugfix-camera-scroll-savegame branch from 513cdf8 to 7797d40 Compare December 17, 2025 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something is not working right, typically is user facing Minor Severity: Minor < Major < Critical < Blocker ThisProject The issue was introduced by this project, or this task is specific to this project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants