Fix setting spawn with -noclip sometimes allowing clipping through blocks

This commit is contained in:
Goodlyay 2024-05-09 19:38:40 -07:00
parent 7fd7d489f1
commit df3e6834d6

View File

@ -892,7 +892,9 @@ cc_bool LocalPlayer_HandleSetSpawn(struct LocalPlayer* p) {
/* Spawn is normally centered to match vanilla Minecraft classic */
if (!p->Hacks.CanNoclip) {
p->Spawn = p->Base.Position;
/* Don't want to use Position because it is interpolated between prev and next. */
/* This means it can be halfway between stepping up a stair and clip through the floor. */
p->Spawn = p->Base.prev.pos;
} else {
p->Spawn.x = Math_Floor(p->Base.Position.x) + 0.5f;
p->Spawn.y = p->Base.Position.y;