Merge pull request 'Fix player start zpos being ignored on UDMF maps (fixes #152)' (#153) from Wumbo/blankart:fixudmfspawns into blankart-dev

Reviewed-on: https://codeberg.org/NepDisk/blankart/pulls/153
This commit is contained in:
NepDisk 2025-10-04 04:34:41 +02:00
commit 1ca099ae48

View file

@ -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)