fix: a new world knows its world spawn before its first save

The world spawn was only filled in when the world was first saved, from
the player's spawn point at that moment: a bed slept in before then became
the world spawn, and anything asking for the world spawn earlier (a
guest's respawn) fell back on the host's spawn point instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 03e621ed3af671c0ae695ea2e5b2d1a29d45c84c)
This commit is contained in:
Ludovic Marie
2026-10-20 21:20:40 +02:00
parent b31cb42242
commit f16c0318b7
+3
View File
@@ -3726,6 +3726,9 @@ impl Game<'_> {
f64::from(z) + 0.5,
));
self.level.spawn = Some([f64::from(x), f64::from(y), f64::from(z)]);
// The world's spawn from the start, not only once saved: a bed set
// before the first save must not become it.
self.level.world_spawn.get_or_insert([x, y, z]);
}
let s = self
.level