Normalize view angles in client's usercmd

Must be normalized, bad values (NAN or FLT_MAX) will crash the game. There is more that needs to be clamped, but before we can do this CUserCmd has to be reversed more.
This commit is contained in:
Kawe Mazidjatari 2023-06-06 00:53:05 +02:00
parent 70f89c1bd8
commit a2468bb184

View File

@ -16,6 +16,12 @@
//-----------------------------------------------------------------------------
int ReadUserCmd(bf_read* buf, CUserCmd* move, CUserCmd* from)
{
// Normalize angles, bogus values will crash the game..
from->viewangles.Normalize();
// More clamps coming soon...
const int seed = v_ReadUserCmd(buf, move, from);
// On the client, the frame time must be within 'usercmd_frametime_min'