Closed alexkiri closed 7 months ago
There are several issues at play here. setpos
is executed on the server, where the pitch gets set to 6
degrees. This value is then sent to the client encoded in a 16-bit integer, which doesn't exactly map to 6
, but rather 5.99853515625
. viewpos
is executed on the client, but the value is printed using truncation, so it outputs 5
in this case and not 6
, which would be a much closer representation. I've changed the printing code to use rounding in f1dea3d0aa83b90f7719e598fc86e428be439301. The network protocol does support sending angles as full floats (avoiding precision loss), but that is a global option, it can't be enabled just for player entities.
Using these console commands has a slight inconsistency, as can be seen below. The commands were entered consecutively, without closing the console
The 2nd
viewpos
shows a different position