forked from electronicarts/CnC_Generals_Zero_Hour
-
Notifications
You must be signed in to change notification settings - Fork 89
Labels
BugSomething is not working right, typically is user facingSomething is not working right, typically is user facingGenRelates to GeneralsRelates to GeneralsInputMinorSeverity: Minor < Major < Critical < BlockerSeverity: Minor < Major < Critical < BlockerThisProjectThe issue was introduced by this project, or this task is specific to this projectThe issue was introduced by this project, or this task is specific to this projectZHRelates to Zero HourRelates to Zero Hour
Milestone
Description
Prerequisites
- I have searched for similar issues and confirmed this is not a duplicate
Game Version
- Command & Conquer Generals
- Command & Conquer Generals: Zero Hour
- Other (please specify below)
Bug Description
Seems to be caused by PR #1430
If you select a dozer, cancel a building placement, it takes 2 clicks to deselect the dozer. This happens when Alternative Mouse mode is ON. When it is OFF, the bug doesn't occur.
Found on VS 2022 build (debug and release)
Reproduction Steps
- Alternative Mouse mode is ON
- Select a worker
- choose a building
- cancel the building placement with RIGHT CLICK
- the building placement is canceled and the worker is not deselected (as intented with the fix)
- now LEFT click somewhere to deselect the worker
- the worker is not deselected
- LEFT click again, and the worker is deselected
Additional Context
This probably is caused here (SelectionXlat.cpp):
//In alternate mouse mode, right click still cancels building placement.
// TheSuperHackers @tweak Stubbjax 08/08/2025 Cancelling building placement no longer deselects the builder.
if (TheInGameUI->getPendingPlaceSourceObjectID() != INVALID_ID)
{
TheInGameUI->placeBuildAvailable(NULL, NULL);
disp = DESTROY_MESSAGE;
TheInGameUI->setScrolling(FALSE);
}
This call: TheInGameUI->placeBuildAvailable(NULL, NULL);
sets preventLeftClickDeselectionInAlternateMouseModeForOneClick
to TRUE.
A quick fix could be to add TheInGameUI->setPreventLeftClickDeselectionInAlternateMouseModeForOneClick(FALSE);
this after the placeBuildAvailable
.
Metadata
Metadata
Assignees
Labels
BugSomething is not working right, typically is user facingSomething is not working right, typically is user facingGenRelates to GeneralsRelates to GeneralsInputMinorSeverity: Minor < Major < Critical < BlockerSeverity: Minor < Major < Critical < BlockerThisProjectThe issue was introduced by this project, or this task is specific to this projectThe issue was introduced by this project, or this task is specific to this projectZHRelates to Zero HourRelates to Zero Hour