Skip to content

Commit

Permalink
Fix setting spawn with -noclip sometimes allowing clipping through bl…
Browse files Browse the repository at this point in the history
…ocks
  • Loading branch information
Goodlyay committed May 10, 2024
1 parent 7fd7d48 commit df3e683
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Entity.c
Expand Up @@ -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;
Expand Down

0 comments on commit df3e683

Please sign in to comment.