mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-26 06:11:01 +00:00
Use mt->z instead of mt->options >> ZSHIFT in Command_Teleport_f
This commit is contained in:
parent
855f5da6c9
commit
f86c5f13ce
1 changed files with 4 additions and 10 deletions
|
@ -517,6 +517,7 @@ void Command_Teleport_f(void)
|
||||||
if (!starpostnum) // spawnpoints...
|
if (!starpostnum) // spawnpoints...
|
||||||
{
|
{
|
||||||
mapthing_t *mt;
|
mapthing_t *mt;
|
||||||
|
fixed_t offset;
|
||||||
|
|
||||||
if (starpostpath >= numcoopstarts)
|
if (starpostpath >= numcoopstarts)
|
||||||
{
|
{
|
||||||
|
@ -527,6 +528,7 @@ void Command_Teleport_f(void)
|
||||||
mt = playerstarts[starpostpath]; // Given above check, should never be NULL.
|
mt = playerstarts[starpostpath]; // Given above check, should never be NULL.
|
||||||
intx = mt->x<<FRACBITS;
|
intx = mt->x<<FRACBITS;
|
||||||
inty = mt->y<<FRACBITS;
|
inty = mt->y<<FRACBITS;
|
||||||
|
offset = mt->z<<FRACBITS;
|
||||||
|
|
||||||
ss = R_IsPointInSubsector(intx, inty);
|
ss = R_IsPointInSubsector(intx, inty);
|
||||||
if (!ss || ss->sector->ceilingheight - ss->sector->floorheight < p->mo->height)
|
if (!ss || ss->sector->ceilingheight - ss->sector->floorheight < p->mo->height)
|
||||||
|
@ -538,17 +540,9 @@ void Command_Teleport_f(void)
|
||||||
// Flagging a player's ambush will make them start on the ceiling
|
// Flagging a player's ambush will make them start on the ceiling
|
||||||
// Objectflip inverts
|
// Objectflip inverts
|
||||||
if (!!(mt->options & MTF_AMBUSH) ^ !!(mt->options & MTF_OBJECTFLIP))
|
if (!!(mt->options & MTF_AMBUSH) ^ !!(mt->options & MTF_OBJECTFLIP))
|
||||||
{
|
intz = ss->sector->ceilingheight - p->mo->height - offset;
|
||||||
intz = ss->sector->ceilingheight - p->mo->height;
|
|
||||||
if (mt->options >> ZSHIFT)
|
|
||||||
intz -= ((mt->options >> ZSHIFT) << FRACBITS);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
intz = ss->sector->floorheight + offset;
|
||||||
intz = ss->sector->floorheight;
|
|
||||||
if (mt->options >> ZSHIFT)
|
|
||||||
intz += ((mt->options >> ZSHIFT) << FRACBITS);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mt->options & MTF_OBJECTFLIP) // flip the player!
|
if (mt->options & MTF_OBJECTFLIP) // flip the player!
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue