This commit is contained in:
Christoph Oelckers 2016-01-17 00:14:59 +01:00
commit 724475823c
4 changed files with 34 additions and 42 deletions

View file

@ -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_CheckMove(AActor *thing, fixed_t x, fixed_t y);
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_SlideMove (AActor* mo, fixed_t tryx, fixed_t tryy, int numsteps);
bool P_BounceWall (AActor *mo);

View file

@ -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;
sector_t *oldsec = thing->Sector;
@ -455,6 +455,8 @@ bool P_TeleportMove(AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefra
return false;
}
if (modifyactor)
{
// the move is ok, so link the thing into its new position
thing->SetOrigin(x, y, z);
thing->floorz = tmf.floorz;
@ -487,6 +489,7 @@ bool P_TeleportMove(AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefra
{
thing->CheckSectorTransition(oldsec);
}
}
return true;
}

View file

@ -985,7 +985,7 @@ void FPathTraverse::AddLineIntercepts(int bx, int by)
P_MakeDivline (ld, &dl);
frac = P_InterceptVector (&trace, &dl);
if (frac < 0 || frac > 1) continue; // behind source or beyond end point
if (frac < 0 || frac > FRACUNIT) continue; // behind source or beyond end point
intercept_t newintercept;

View file

@ -3023,18 +3023,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Respawn)
if (flags & RSF_TELEFRAG)
{
// [KS] DIE DIE DIE DIE erm *ahem* =)
oktorespawn = P_TeleportMove(self, self->x, self->y, self->z, true);
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);
}
oktorespawn = P_TeleportMove(self, self->x, self->y, self->z, true, false);
}
else
{