From 3d188777acb53b044964333c334f26f6350efa41 Mon Sep 17 00:00:00 2001 From: Wumbo <58399748+WumboSpasm@users.noreply.github.com> Date: Fri, 3 Oct 2025 21:47:26 -0400 Subject: [PATCH] Fix player start zpos being ignored on UDMF maps --- src/p_mobj.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index b4ed6b795..73467b127 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -12600,11 +12600,13 @@ void P_MovePlayerToSpawn(INT32 playernum, mapthing_t *mthing) if (mthing) { + fixed_t offset = udmf ? mthing->z << FRACBITS : 0; + // Setting the spawnpoint's args[0] will make the player start on the ceiling // Objectflip inverts if (!!(mthing->args[0]) ^ !!(mthing->options & MTF_OBJECTFLIP)) { - z = ceiling - mobjinfo[MT_PLAYER].height; + z = ceiling - mobjinfo[MT_PLAYER].height - offset; if (mthing->options >> ZSHIFT) z -= ((mthing->options >> ZSHIFT) << FRACBITS); if (p->respawn) @@ -12612,7 +12614,7 @@ void P_MovePlayerToSpawn(INT32 playernum, mapthing_t *mthing) } else { - z = floor; + z = floor + offset; if (mthing->options >> ZSHIFT) z += ((mthing->options >> ZSHIFT) << FRACBITS); if (p->respawn)