Skip to content

Commit cd86cc4

Browse files
authored
bugfix(input): Fix broken single click command after right mouse double click (#1605)
1 parent a2cebd8 commit cd86cc4

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3533,9 +3533,13 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
35333533
}
35343534

35353535
//-----------------------------------------------------------------------------
3536-
case GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_DOWN:
3537-
{
3538-
// There are two ways in which we can ignore this as a deselect:
3536+
// TheSuperHackers @bugfix Treat the raw double click event identical to the raw button down event
3537+
// because it implicitly is a raw button down event as well. Failing to do so would mess with the
3538+
// button timings in later events on button up.
3539+
case GameMessage::MSG_RAW_MOUSE_RIGHT_DOUBLE_CLICK:
3540+
case GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_DOWN:
3541+
{
3542+
// There are two ways in which we can ignore this as a deselect:
35393543
// 1) 2-D position on screen
35403544
// 2) Time has exceeded the time which we allow for this to be a click.
35413545
m_mouseRightDragAnchor = msg->getArgument( 0 )->pixel;

GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3874,6 +3874,10 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
38743874
}
38753875

38763876
//-----------------------------------------------------------------------------
3877+
// TheSuperHackers @bugfix Treat the raw double click event identical to the raw button down event
3878+
// because it implicitly is a raw button down event as well. Failing to do so would mess with the
3879+
// button timings in later events on button up.
3880+
case GameMessage::MSG_RAW_MOUSE_RIGHT_DOUBLE_CLICK:
38773881
case GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_DOWN:
38783882
{
38793883
// There are two ways in which we can ignore this as a deselect:

0 commit comments

Comments
 (0)