forked from EXTERNAL/bareiron
account for unclamped yaw value
This commit is contained in:
2
main.c
2
main.c
@@ -170,7 +170,7 @@ void handlePacket (int client_fd, int length, int packet_id) {
|
|||||||
player->y = cy;
|
player->y = cy;
|
||||||
player->z = cz;
|
player->z = cz;
|
||||||
if (packet_id == 0x1E) {
|
if (packet_id == 0x1E) {
|
||||||
player->yaw = (short)yaw % 180 * 127 / 180;
|
player->yaw = ((short)(yaw + 540) % 360 - 180) * 127 / 180;
|
||||||
player->pitch = pitch / 90.0f * 127.0f;
|
player->pitch = pitch / 90.0f * 127.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user