invert mouse again for movement, so that it cancels out the first inversion

This commit is contained in:
Ricardo Luís Vaz Silva 2023-11-18 16:25:01 -03:00 committed by Rachael Alexanderson
parent a6ff63951f
commit 11f2fc10ea

View file

@ -208,7 +208,10 @@ CVAR (Float, m_forward, 1.f, CVAR_GLOBALCONFIG|CVAR_ARCHIVE)
CVAR (Float, m_side, 2.f, CVAR_GLOBALCONFIG|CVAR_ARCHIVE)
int turnheld; // for accelerative turning
EXTERN_CVAR (Bool, invertmouse)
EXTERN_CVAR (Bool, invertmousex)
// mouse values are used once
float mousex;
float mousey;
@ -1035,9 +1038,23 @@ bool G_Responder (event_t *ev)
break;
// [RH] mouse buttons are sent as key up/down events
case EV_Mouse:
mousex = ev->x;
mousey = ev->y;
case EV_Mouse:
if(invertmousex)
{
mousex = -ev->x;
}
else
{
mousex = ev->x;
}
if(invertmouse)
{
mousey = -ev->y;
}
else
{
mousey = ev->y;
}
break;
}