Fixed SV_SAMESPAWNSPOT behavior -- When enabled, use the p->mo->z. Otherwise, rely on ONCEILINGZ/FLOATRANDZ/ONFLOORZ w/ or w/o UsePlayerStartZ as previously done

This commit is contained in:
Kyle Evans 2014-12-03 00:50:05 -06:00
parent 689b39ed30
commit c631ffc5fd

View file

@ -4302,12 +4302,15 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
{
spawn_x = p->mo->x;
spawn_y = p->mo->y;
spawn_z = p->mo->z;
spawn_angle = p->mo->angle;
}
else
{
spawn_x = mthing->x;
spawn_y = mthing->y;
// Allow full angular precision but avoid roundoff errors for multiples of 45 degrees.
if (mthing->angle % 45 != 0)
{
@ -4321,7 +4324,6 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
{
spawn_angle += 1 << ANGLETOFINESHIFT;
}
}
if (GetDefaultByType(p->cls)->flags & MF_SPAWNCEILING)
spawn_z = ONCEILINGZ;
@ -4329,6 +4331,7 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
spawn_z = FLOATRANDZ;
else
spawn_z = ONFLOORZ;
}
mobj = static_cast<APlayerPawn *>
(Spawn (p->cls, spawn_x, spawn_y, spawn_z, NO_REPLACE));