1
0
mirror of https://github.com/p2r3/bareiron.git synced 2025-10-01 23:25:09 +02:00

fix storing wrong integer player position at negative coordinates

This commit is contained in:
p2r3
2025-08-29 00:29:47 +03:00
parent ca6f8afbea
commit e4267e7edf
2 changed files with 4 additions and 2 deletions

View File

@@ -243,9 +243,9 @@ void spawnPlayer (PlayerData *player) {
player->flags &= ~0x02;
} else { // Not a new player
// Calculate spawn position from player data
spawn_x = player->x > 0 ? (float)player->x + 0.5 : (float)player->x - 0.5;
spawn_x = (float)player->x + 0.5;
spawn_y = player->y;
spawn_z = player->z > 0 ? (float)player->z + 0.5 : (float)player->z - 0.5;
spawn_z = (float)player->z + 0.5;
spawn_yaw = player->yaw * 180 / 127;
spawn_pitch = player->pitch * 90 / 127;
}