1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 00:25:19 +02:00

Enforce limits of settings that could cause buggy behaviour (#12450)

Enforces the setting value bounds that are currently only limited by the GUI (settingtypes.txt).
This commit is contained in:
SmallJoker
2022-07-09 22:32:08 +02:00
committed by GitHub
parent 7c261118e0
commit 051181fa6e
28 changed files with 74 additions and 56 deletions

View File

@@ -843,7 +843,7 @@ void TouchScreenGUI::translateEvent(const SEvent &event)
s32 dy = Y - m_pointerpos[event.TouchInput.ID].Y;
// adapt to similar behaviour as pc screen
double d = g_settings->getFloat("mouse_sensitivity") * 3.0f;
const double d = g_settings->getFloat("mouse_sensitivity", 0.001f, 10.0f) * 3.0f;
m_camera_yaw_change -= dx * d;
m_camera_pitch = MYMIN(MYMAX(m_camera_pitch + (dy * d), -180), 180);