mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
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:
parent
70f89c1bd8
commit
a2468bb184
@ -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'
|
||||
|
Loading…
x
Reference in New Issue
Block a user