mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 20:43:15 +00:00
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:
parent
689b39ed30
commit
c631ffc5fd
1 changed files with 10 additions and 7 deletions
|
@ -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,14 +4324,14 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
|
|||
{
|
||||
spawn_angle += 1 << ANGLETOFINESHIFT;
|
||||
}
|
||||
}
|
||||
|
||||
if (GetDefaultByType(p->cls)->flags & MF_SPAWNCEILING)
|
||||
spawn_z = ONCEILINGZ;
|
||||
else if (GetDefaultByType(p->cls)->flags2 & MF2_SPAWNFLOAT)
|
||||
spawn_z = FLOATRANDZ;
|
||||
else
|
||||
spawn_z = ONFLOORZ;
|
||||
if (GetDefaultByType(p->cls)->flags & MF_SPAWNCEILING)
|
||||
spawn_z = ONCEILINGZ;
|
||||
else if (GetDefaultByType(p->cls)->flags2 & MF2_SPAWNFLOAT)
|
||||
spawn_z = FLOATRANDZ;
|
||||
else
|
||||
spawn_z = ONFLOORZ;
|
||||
}
|
||||
|
||||
mobj = static_cast<APlayerPawn *>
|
||||
(Spawn (p->cls, spawn_x, spawn_y, spawn_z, NO_REPLACE));
|
||||
|
|
Loading…
Reference in a new issue