mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Use mthing->z instead of mthing->options >> ZSHIFT in G_AddGhost
This commit is contained in:
parent
63b5ee0650
commit
b1a43c7c4a
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…
Add table
Reference in a new issue