From ffa014a21c8c2885a17add41c3a2d9b3d4e8cb47 Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Tue, 26 Aug 2025 19:06:50 +1000 Subject: [PATCH 1/2] bugfix: Prevent command execution when attempting to exit context while moving the camera --- .../Source/GameClient/MessageStream/SelectionXlat.cpp | 6 ------ .../Source/GameClient/MessageStream/SelectionXlat.cpp | 6 ------ 2 files changed, 12 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp index 3c80c251caf..8ed49c16219 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp @@ -919,12 +919,6 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa Bool isClick = TheMouse->isClick(&m_deselectFeedbackAnchor, &pixel, m_lastClick, currentTime); - if (isClick && - cameraPos.length() > TheMouse->m_dragTolerance3D) - { - isClick = FALSE; - } - // right click behavior (not right drag) if (isClick) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp index aa7831567b0..f50118d1b06 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp @@ -995,12 +995,6 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa Bool isClick = TheMouse->isClick(&m_deselectFeedbackAnchor, &pixel, m_lastClick, currentTime); - if (isClick && - cameraPos.length() > TheMouse->m_dragTolerance3D) - { - isClick = FALSE; - } - // right click behavior (not right drag) if (isClick) { From 81e0845b624da70bfa8336c6035648e888661005 Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Wed, 27 Aug 2025 12:35:00 +1000 Subject: [PATCH 2/2] refactor: Remove unnecessary assignment --- .../Source/GameClient/MessageStream/SelectionXlat.cpp | 4 +--- .../Source/GameClient/MessageStream/SelectionXlat.cpp | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp index 8ed49c16219..00e42a7a8a7 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp @@ -917,10 +917,8 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa ICoord2D pixel = msg->getArgument( 0 )->pixel; UnsignedInt currentTime = (UnsignedInt) msg->getArgument( 2 )->integer; - Bool isClick = TheMouse->isClick(&m_deselectFeedbackAnchor, &pixel, m_lastClick, currentTime); - // right click behavior (not right drag) - if (isClick) + if (TheMouse->isClick(&m_deselectFeedbackAnchor, &pixel, m_lastClick, currentTime)) { //Added support to cancel the GUI command without deselecting the unit(s) involved //when you right click. diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp index f50118d1b06..6209cabd917 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp @@ -993,10 +993,8 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa ICoord2D pixel = msg->getArgument( 0 )->pixel; UnsignedInt currentTime = (UnsignedInt) msg->getArgument( 2 )->integer; - Bool isClick = TheMouse->isClick(&m_deselectFeedbackAnchor, &pixel, m_lastClick, currentTime); - // right click behavior (not right drag) - if (isClick) + if (TheMouse->isClick(&m_deselectFeedbackAnchor, &pixel, m_lastClick, currentTime)) { //Added support to cancel the GUI command without deselecting the unit(s) involved //when you right click.