Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit f526b81

Browse files
committed
Added topkek fixes for multiplayer mousewheel handling
1 parent 57eb974 commit f526b81

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Managers/NetworkClient.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,12 @@ namespace RTE {
246246
m_MouseButtonPressedState[i] = -1;
247247
m_MouseButtonReleasedState[i] = -1;
248248
}
249-
250-
msg.MouseWheelMoved = g_UInputMan.MouseWheelMoved();
249+
if (m_MouseWheelMoved != 0) {
250+
msg.MouseWheelMoved = m_MouseWheelMoved;
251+
m_MouseWheelMoved = 0;
252+
} else {
253+
msg.MouseWheelMoved = 0;
254+
}
251255

252256
msg.InputElementHeld = 0;
253257
msg.InputElementPressed = 0;
@@ -984,6 +988,10 @@ namespace RTE {
984988
if (m_MouseButtonReleasedState[MOUSE_RIGHT] < 1) { m_MouseButtonReleasedState[MOUSE_RIGHT] = g_UInputMan.MouseButtonReleased(MOUSE_RIGHT, -1) ? 1 : 0; }
985989
if (m_MouseButtonReleasedState[MOUSE_MIDDLE] < 1) { m_MouseButtonReleasedState[MOUSE_MIDDLE] = g_UInputMan.MouseButtonReleased(MOUSE_MIDDLE, -1) ? 1 : 0; }
986990

991+
if (g_UInputMan.MouseWheelMoved() != 0) {
992+
m_MouseWheelMoved = g_UInputMan.MouseWheelMoved();
993+
}
994+
987995
// Input is sent at whatever settings are set in inputs per second
988996
float inputSend = m_ClientInputFps;
989997

Managers/NetworkClient.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ namespace RTE {
187187

188188
int m_MouseButtonPressedState[3]; //!<
189189
int m_MouseButtonReleasedState[3]; //!<
190+
int m_MouseWheelMoved; //!< Whether the mousewheel was moved this Update. Used to make mousewheel detection better.
190191

191192
private:
192193

0 commit comments

Comments
 (0)