mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-14 08:30:49 +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_x = p->mo->x;
|
||||||
spawn_y = p->mo->y;
|
spawn_y = p->mo->y;
|
||||||
|
spawn_z = p->mo->z;
|
||||||
|
|
||||||
spawn_angle = p->mo->angle;
|
spawn_angle = p->mo->angle;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
spawn_x = mthing->x;
|
spawn_x = mthing->x;
|
||||||
spawn_y = mthing->y;
|
spawn_y = mthing->y;
|
||||||
|
|
||||||
// Allow full angular precision but avoid roundoff errors for multiples of 45 degrees.
|
// Allow full angular precision but avoid roundoff errors for multiples of 45 degrees.
|
||||||
if (mthing->angle % 45 != 0)
|
if (mthing->angle % 45 != 0)
|
||||||
{
|
{
|
||||||
|
@ -4321,7 +4324,6 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
|
||||||
{
|
{
|
||||||
spawn_angle += 1 << ANGLETOFINESHIFT;
|
spawn_angle += 1 << ANGLETOFINESHIFT;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (GetDefaultByType(p->cls)->flags & MF_SPAWNCEILING)
|
if (GetDefaultByType(p->cls)->flags & MF_SPAWNCEILING)
|
||||||
spawn_z = ONCEILINGZ;
|
spawn_z = ONCEILINGZ;
|
||||||
|
@ -4329,6 +4331,7 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
|
||||||
spawn_z = FLOATRANDZ;
|
spawn_z = FLOATRANDZ;
|
||||||
else
|
else
|
||||||
spawn_z = ONFLOORZ;
|
spawn_z = ONFLOORZ;
|
||||||
|
}
|
||||||
|
|
||||||
mobj = static_cast<APlayerPawn *>
|
mobj = static_cast<APlayerPawn *>
|
||||||
(Spawn (p->cls, spawn_x, spawn_y, spawn_z, NO_REPLACE));
|
(Spawn (p->cls, spawn_x, spawn_y, spawn_z, NO_REPLACE));
|
||||||
|
|
Loading…
Reference in a new issue