mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-26 22:31:10 +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);
|
||||
{ // 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 offset = mthing->z << FRACBITS;
|
||||
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;
|
||||
c = gh->mo->ceilingz - mobjinfo[MT_PLAYER].height;
|
||||
if (!!(mthing->options & MTF_AMBUSH) ^ !!(mthing->options & MTF_OBJECTFLIP))
|
||||
{
|
||||
z = c;
|
||||
if (mthing->options >> ZSHIFT)
|
||||
z -= ((mthing->options >> ZSHIFT) << FRACBITS);
|
||||
z = c - offset;
|
||||
if (z < f)
|
||||
z = f;
|
||||
}
|
||||
else
|
||||
{
|
||||
z = f;
|
||||
if (mthing->options >> ZSHIFT)
|
||||
z += ((mthing->options >> ZSHIFT) << FRACBITS);
|
||||
z = f + offset;
|
||||
if (z > c)
|
||||
z = c;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue