mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-13 07:57:51 +00:00
- added a 'non-modify' mode to P_TeleportMove and let A_Respawn use that, rather than letting P_TeleportMove muck around with the actor properties and then have A_Respawn only partially and haphazardly restoring them afterward.
This commit is contained in:
parent
c3491de466
commit
0e645ad173
3 changed files with 33 additions and 41 deletions
|
@ -464,7 +464,7 @@ bool P_TryMove (AActor* thing, fixed_t x, fixed_t y, int dropoff, const secplane
|
||||||
bool P_TryMove (AActor* thing, fixed_t x, fixed_t y, int dropoff, const secplane_t * onfloor = NULL);
|
bool P_TryMove (AActor* thing, fixed_t x, fixed_t y, int dropoff, const secplane_t * onfloor = NULL);
|
||||||
bool P_CheckMove(AActor *thing, fixed_t x, fixed_t y);
|
bool P_CheckMove(AActor *thing, fixed_t x, fixed_t y);
|
||||||
void P_ApplyTorque(AActor *mo);
|
void P_ApplyTorque(AActor *mo);
|
||||||
bool P_TeleportMove (AActor* thing, fixed_t x, fixed_t y, fixed_t z, bool telefrag); // [RH] Added z and telefrag parameters
|
bool P_TeleportMove (AActor* thing, fixed_t x, fixed_t y, fixed_t z, bool telefrag, bool modifyactor = true); // [RH] Added z and telefrag parameters
|
||||||
void P_PlayerStartStomp (AActor *actor); // [RH] Stomp on things for a newly spawned player
|
void P_PlayerStartStomp (AActor *actor); // [RH] Stomp on things for a newly spawned player
|
||||||
void P_SlideMove (AActor* mo, fixed_t tryx, fixed_t tryy, int numsteps);
|
void P_SlideMove (AActor* mo, fixed_t tryx, fixed_t tryy, int numsteps);
|
||||||
bool P_BounceWall (AActor *mo);
|
bool P_BounceWall (AActor *mo);
|
||||||
|
|
|
@ -376,7 +376,7 @@ void P_FindFloorCeiling(AActor *actor, int flags)
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
bool P_TeleportMove(AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefrag)
|
bool P_TeleportMove(AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefrag, bool modifyactor)
|
||||||
{
|
{
|
||||||
FCheckPosition tmf;
|
FCheckPosition tmf;
|
||||||
sector_t *oldsec = thing->Sector;
|
sector_t *oldsec = thing->Sector;
|
||||||
|
@ -455,37 +455,40 @@ bool P_TeleportMove(AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefra
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// the move is ok, so link the thing into its new position
|
if (modifyactor)
|
||||||
thing->SetOrigin(x, y, z);
|
|
||||||
thing->floorz = tmf.floorz;
|
|
||||||
thing->ceilingz = tmf.ceilingz;
|
|
||||||
thing->floorsector = tmf.floorsector;
|
|
||||||
thing->floorpic = tmf.floorpic;
|
|
||||||
thing->floorterrain = tmf.floorterrain;
|
|
||||||
thing->ceilingsector = tmf.ceilingsector;
|
|
||||||
thing->ceilingpic = tmf.ceilingpic;
|
|
||||||
thing->dropoffz = tmf.dropoffz; // killough 11/98
|
|
||||||
thing->BlockingLine = NULL;
|
|
||||||
|
|
||||||
if (thing->flags2 & MF2_FLOORCLIP)
|
|
||||||
{
|
{
|
||||||
thing->AdjustFloorClip();
|
// the move is ok, so link the thing into its new position
|
||||||
}
|
thing->SetOrigin(x, y, z);
|
||||||
|
thing->floorz = tmf.floorz;
|
||||||
|
thing->ceilingz = tmf.ceilingz;
|
||||||
|
thing->floorsector = tmf.floorsector;
|
||||||
|
thing->floorpic = tmf.floorpic;
|
||||||
|
thing->floorterrain = tmf.floorterrain;
|
||||||
|
thing->ceilingsector = tmf.ceilingsector;
|
||||||
|
thing->ceilingpic = tmf.ceilingpic;
|
||||||
|
thing->dropoffz = tmf.dropoffz; // killough 11/98
|
||||||
|
thing->BlockingLine = NULL;
|
||||||
|
|
||||||
if (thing == players[consoleplayer].camera)
|
if (thing->flags2 & MF2_FLOORCLIP)
|
||||||
{
|
{
|
||||||
R_ResetViewInterpolation();
|
thing->AdjustFloorClip();
|
||||||
}
|
}
|
||||||
|
|
||||||
thing->PrevX = x;
|
if (thing == players[consoleplayer].camera)
|
||||||
thing->PrevY = y;
|
{
|
||||||
thing->PrevZ = z;
|
R_ResetViewInterpolation();
|
||||||
|
}
|
||||||
|
|
||||||
// If this teleport was caused by a move, P_TryMove() will handle the
|
thing->PrevX = x;
|
||||||
// sector transition messages better than we can here.
|
thing->PrevY = y;
|
||||||
if (!(thing->flags6 & MF6_INTRYMOVE))
|
thing->PrevZ = z;
|
||||||
{
|
|
||||||
thing->CheckSectorTransition(oldsec);
|
// If this teleport was caused by a move, P_TryMove() will handle the
|
||||||
|
// sector transition messages better than we can here.
|
||||||
|
if (!(thing->flags6 & MF6_INTRYMOVE))
|
||||||
|
{
|
||||||
|
thing->CheckSectorTransition(oldsec);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -3023,18 +3023,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Respawn)
|
||||||
if (flags & RSF_TELEFRAG)
|
if (flags & RSF_TELEFRAG)
|
||||||
{
|
{
|
||||||
// [KS] DIE DIE DIE DIE erm *ahem* =)
|
// [KS] DIE DIE DIE DIE erm *ahem* =)
|
||||||
oktorespawn = P_TeleportMove(self, self->x, self->y, self->z, true);
|
oktorespawn = P_TeleportMove(self, self->x, self->y, self->z, true, false);
|
||||||
if (oktorespawn)
|
|
||||||
{ // Need to do this over again, since P_TeleportMove() will redo
|
|
||||||
// it with the proper point-on-side calculation.
|
|
||||||
self->UnlinkFromWorld();
|
|
||||||
self->LinkToWorld(true);
|
|
||||||
sector_t *sec = self->Sector;
|
|
||||||
self->dropoffz =
|
|
||||||
self->floorz = sec->floorplane.ZatPoint(self->x, self->y);
|
|
||||||
self->ceilingz = sec->ceilingplane.ZatPoint(self->x, self->y);
|
|
||||||
P_FindFloorCeiling(self, FFCF_ONLYSPAWNPOS);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue