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

Commit 268d7ce

Browse files
committed
Remove duplicate code
1 parent e90b53d commit 268d7ce

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

Managers/UInputMan.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -965,23 +965,17 @@ namespace RTE {
965965
}
966966
}
967967

968-
// Mouse wheel update, translate motion into discrete ticks
969-
if (std::abs(mouse_z) >= 1) {
970-
m_MouseWheelChange = mouse_z;
971-
position_mouse_z(0);
972-
} else {
973-
m_MouseWheelChange = 0;
974-
}
975-
976968
// Enable the mouse cursor positioning again after having been disabled. Only do this when the mouse is within the drawing area so it
977969
// won't cause the whole window to move if the user clicks the title bar and unintentionally drags it due to programmatic positioning.
978970
int mousePosX = mouse_x / g_FrameMan.ResolutionMultiplier();
979971
int mousePosY = mouse_y / g_FrameMan.ResolutionMultiplier();
980972
if (m_DisableMouseMoving && m_PrepareToEnableMouseMoving && (mousePosX >= 0 && mousePosX < g_FrameMan.GetResX() && mousePosY >= 0 && mousePosY < g_FrameMan.GetResY())) {
981973
m_DisableMouseMoving = m_PrepareToEnableMouseMoving = false;
982974
}
983-
} else if (g_InActivity == false) {
984-
// Mouse wheel update for menus, regardless of player devices.
975+
}
976+
if (mousePlayer != Players::NoPlayer || g_InActivity == false) {
977+
// Mouse wheel update happens while a device is kb+mouse and while in the menus regardless of player devices.
978+
// Translate motion into discrete ticks.
985979
if (std::abs(mouse_z) >= 1) {
986980
m_MouseWheelChange = mouse_z;
987981
position_mouse_z(0);

0 commit comments

Comments
 (0)