From df3e6834d6a7d1e03a0639ee418e03a59421dcaf Mon Sep 17 00:00:00 2001 From: Goodlyay Date: Thu, 9 May 2024 19:38:40 -0700 Subject: [PATCH] Fix setting spawn with -noclip sometimes allowing clipping through blocks --- src/Entity.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Entity.c b/src/Entity.c index c51dfc702..165414f4a 100644 --- a/src/Entity.c +++ b/src/Entity.c @@ -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;