mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-24 13:11:33 +00:00
- fixed some issues with teleport fog:
* many calls didn't use TELEFOGHEIGHT, mostly those coming from external code submissions that never were tested on anything but Doom. Addressed by adding this value inside P_SpawnTeleportFog and making the distinction between projectiles and non-projectiles from P_Teleport also part of this function. * there were still a few places which spawned the teleport fog directly, skipping all the added features of P_SpawnTeleportFog.
This commit is contained in:
parent
8a08fb2f6a
commit
1703842a94
6 changed files with 10 additions and 10 deletions
|
@ -287,8 +287,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_GenWizard)
|
|||
self->SetState (self->FindState(NAME_Death));
|
||||
self->flags &= ~MF_MISSILE;
|
||||
mo->master = self->target;
|
||||
// Heretic did not offset it by TELEFOGHEIGHT, so I won't either.
|
||||
Spawn<ATeleportFog> (self->Pos(), ALLOW_REPLACE);
|
||||
P_SpawnTeleportFog(self, self->Pos(), false, true);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include "farchive.h"
|
||||
#include "d_player.h"
|
||||
#include "a_morph.h"
|
||||
#include "p_spec.h"
|
||||
|
||||
// Include all the other Heretic stuff here to reduce compile time
|
||||
#include "a_chicken.cpp"
|
||||
|
|
|
@ -115,7 +115,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Beacon)
|
|||
|
||||
rebel->SetState (rebel->SeeState);
|
||||
rebel->Angles.Yaw = self->Angles.Yaw;
|
||||
Spawn<ATeleportFog> (rebel->Vec3Angle(20., self->Angles.Yaw, TELEFOGHEIGHT), ALLOW_REPLACE);
|
||||
P_SpawnTeleportFog(rebel, rebel->Vec3Angle(20., self->Angles.Yaw, 0), false, true);
|
||||
if (--self->health < 0)
|
||||
{
|
||||
self->SetState(self->FindState(NAME_Death));
|
||||
|
|
|
@ -2789,10 +2789,10 @@ void P_NightmareRespawn (AActor *mobj)
|
|||
mo->Prev.Z = z; // Do not interpolate Z position if we changed it since spawning.
|
||||
|
||||
// spawn a teleport fog at old spot because of removal of the body?
|
||||
P_SpawnTeleportFog(mobj, mobj->PosPlusZ(TELEFOGHEIGHT), true, true);
|
||||
P_SpawnTeleportFog(mobj, mobj->Pos(), true, true);
|
||||
|
||||
// spawn a teleport fog at the new spot
|
||||
P_SpawnTeleportFog(mobj, DVector3(mobj->SpawnPoint, z + TELEFOGHEIGHT), false, true);
|
||||
P_SpawnTeleportFog(mobj, DVector3(mobj->SpawnPoint, z), false, true);
|
||||
|
||||
// remove the old monster
|
||||
mobj->Destroy ();
|
||||
|
@ -4685,7 +4685,7 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
|
|||
|
||||
if (multiplayer)
|
||||
{
|
||||
Spawn ("TeleportFog", mobj->Vec3Angle(20., mobj->Angles.Yaw, TELEFOGHEIGHT), ALLOW_REPLACE);
|
||||
P_SpawnTeleportFog(mobj, mobj->Vec3Angle(20., mobj->Angles.Yaw, 0.), false, true);
|
||||
}
|
||||
|
||||
// "Fix" for one of the starts on exec.wad MAP01: If you start inside the ceiling,
|
||||
|
|
|
@ -88,7 +88,8 @@ void P_SpawnTeleportFog(AActor *mobj, const DVector3 &pos, bool beforeTele, bool
|
|||
}
|
||||
else
|
||||
{
|
||||
mo = Spawn((beforeTele ? mobj->TeleFogSourceType : mobj->TeleFogDestType), pos, ALLOW_REPLACE);
|
||||
double fogDelta = mobj->flags & MF_MISSILE ? 0 : TELEFOGHEIGHT;
|
||||
mo = Spawn((beforeTele ? mobj->TeleFogSourceType : mobj->TeleFogDestType), DVector3(pos, pos.Z + fogDelta), ALLOW_REPLACE);
|
||||
}
|
||||
|
||||
if (mo != NULL && setTarget)
|
||||
|
@ -191,10 +192,9 @@ bool P_Teleport (AActor *thing, DVector3 pos, DAngle angle, int flags)
|
|||
{
|
||||
if (!predicting)
|
||||
{
|
||||
double fogDelta = thing->flags & MF_MISSILE ? 0 : TELEFOGHEIGHT;
|
||||
DVector2 vector = angle.ToVector(20);
|
||||
DVector2 fogpos = P_GetOffsetPosition(pos.X, pos.Y, vector.X, vector.Y);
|
||||
P_SpawnTeleportFog(thing, DVector3(fogpos, thing->Z() + fogDelta), false, true);
|
||||
P_SpawnTeleportFog(thing, DVector3(fogpos, thing->Z()), false, true);
|
||||
|
||||
}
|
||||
if (thing->player)
|
||||
|
|
|
@ -98,7 +98,7 @@ bool P_Thing_Spawn (int tid, AActor *source, int type, DAngle angle, bool fog, i
|
|||
mobj->Angles.Yaw = (angle != 1000000. ? angle : spot->Angles.Yaw);
|
||||
if (fog)
|
||||
{
|
||||
P_SpawnTeleportFog(mobj, spot->PosPlusZ(TELEFOGHEIGHT), false, true);
|
||||
P_SpawnTeleportFog(mobj, spot->Pos(), false, true);
|
||||
}
|
||||
if (mobj->flags & MF_SPECIAL)
|
||||
mobj->flags |= MF_DROPPED; // Don't respawn
|
||||
|
|
Loading…
Reference in a new issue