mirror of
https://github.com/p2r3/bareiron.git
synced 2025-10-02 07:35:08 +02:00
fix wrong angle encoding
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 = yaw / 180.0f * 127.0f;
|
player->yaw = (short)yaw % 180 * 127 / 180;
|
||||||
player->pitch = pitch / 90.0f * 127.0f;
|
player->pitch = pitch / 90.0f * 127.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -37,8 +37,8 @@ typedef struct {
|
|||||||
short x;
|
short x;
|
||||||
short y;
|
short y;
|
||||||
short z;
|
short z;
|
||||||
uint8_t yaw;
|
int8_t yaw;
|
||||||
uint8_t pitch;
|
int8_t pitch;
|
||||||
uint8_t hotbar;
|
uint8_t hotbar;
|
||||||
uint16_t inventory_items[41];
|
uint16_t inventory_items[41];
|
||||||
uint8_t inventory_count[41];
|
uint8_t inventory_count[41];
|
||||||
|
Reference in New Issue
Block a user