mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-30 08:00:56 +00:00
Use mthing->z instead of mthing->options >> ZSHIFT in G_AddGhost
This commit is contained in:
parent
24e15387b3
commit
7ccb695fa1
1 changed files with 4 additions and 7 deletions
11
src/g_game.c
11
src/g_game.c
|
@ -6629,23 +6629,20 @@ void G_AddGhost(char *defdemoname)
|
||||||
I_Assert(mthing);
|
I_Assert(mthing);
|
||||||
{ // A bit more complex than P_SpawnPlayer because ghosts aren't solid and won't just push themselves out of the ceiling.
|
{ // A bit more complex than P_SpawnPlayer because ghosts aren't solid and won't just push themselves out of the ceiling.
|
||||||
fixed_t z,f,c;
|
fixed_t z,f,c;
|
||||||
|
fixed_t offset = mthing->z << FRACBITS;
|
||||||
gh->mo = P_SpawnMobj(mthing->x << FRACBITS, mthing->y << FRACBITS, 0, MT_GHOST);
|
gh->mo = P_SpawnMobj(mthing->x << FRACBITS, mthing->y << FRACBITS, 0, MT_GHOST);
|
||||||
gh->mo->angle = FixedAngle(mthing->angle*FRACUNIT);
|
gh->mo->angle = FixedAngle(mthing->angle << FRACBITS);
|
||||||
f = gh->mo->floorz;
|
f = gh->mo->floorz;
|
||||||
c = gh->mo->ceilingz - mobjinfo[MT_PLAYER].height;
|
c = gh->mo->ceilingz - mobjinfo[MT_PLAYER].height;
|
||||||
if (!!(mthing->options & MTF_AMBUSH) ^ !!(mthing->options & MTF_OBJECTFLIP))
|
if (!!(mthing->options & MTF_AMBUSH) ^ !!(mthing->options & MTF_OBJECTFLIP))
|
||||||
{
|
{
|
||||||
z = c;
|
z = c - offset;
|
||||||
if (mthing->options >> ZSHIFT)
|
|
||||||
z -= ((mthing->options >> ZSHIFT) << FRACBITS);
|
|
||||||
if (z < f)
|
if (z < f)
|
||||||
z = f;
|
z = f;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
z = f;
|
z = f + offset;
|
||||||
if (mthing->options >> ZSHIFT)
|
|
||||||
z += ((mthing->options >> ZSHIFT) << FRACBITS);
|
|
||||||
if (z > c)
|
if (z > c)
|
||||||
z = c;
|
z = c;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue