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

manually assign y position on first spawn

This commit is contained in:
p2r3
2025-08-25 20:34:06 +03:00
parent e51d03e833
commit 297047b6dd

View File

@@ -213,6 +213,7 @@ void spawnPlayer (PlayerData *player) {
if (player->flags & 0x02) { // Is this a new player? if (player->flags & 0x02) { // Is this a new player?
// Determine spawning Y coordinate based on terrain height // Determine spawning Y coordinate based on terrain height
spawn_y = getHeightAt(8, 8) + 1; spawn_y = getHeightAt(8, 8) + 1;
player->y = spawn_y;
player->flags &= ~0x02; player->flags &= ~0x02;
} else { // Not a new player } else { // Not a new player
// Calculate spawn position from player data // Calculate spawn position from player data