- copied some 3D floor fixes from GZDoom.

- fixed: Crushing polyobject did incomplete checks for blocked moves.


SVN r1355 (trunk)
This commit is contained in:
Christoph Oelckers 2009-01-07 18:45:39 +00:00
parent bf63041585
commit 35cc39f094
6 changed files with 108 additions and 20 deletions

View File

@ -1,3 +1,7 @@
January 7, 2009 (Changes by Graf Zahl)
- copied some 3D floor fixes from GZDoom.
- fixed: Crushing polyobject did incomplete checks for blocked moves.
January 5, 2009 (Changes by Graf Zahl)
- fixed: Parsing of color strings with 6 characters and spaces did not work.
- fixed: State labels must be evaluated for the state's owner, not the calling actor.

View File

@ -1562,7 +1562,20 @@ static EIWADType ScanIWAD (const char *iwad)
}
else if (lumpsfound[Check_map01])
{
if (lumpsfound[Check_redtnt2])
if (lumpsfound[Check_FreeDoom])
{
// Is there a 100% reliable way to tell FreeDoom and FreeDM
// apart based solely on the lump names?
if (strstr(iwad, "freedm.wad") || strstr(iwad, "FREEDM.WAD"))
{
return IWAD_FreeDM;
}
else
{
return IWAD_FreeDoom;
}
}
else if (lumpsfound[Check_redtnt2])
{
return IWAD_Doom2TNT;
}
@ -1583,19 +1596,6 @@ static EIWADType ScanIWAD (const char *iwad)
return IWAD_HexenDemo;
}
}
else if (lumpsfound[Check_FreeDoom])
{
// Is there a 100% reliable way to tell FreeDoom and FreeDM
// apart based solely on the lump names?
if (strstr(iwad, "freedm.wad") || strstr(iwad, "FREEDM.WAD"))
{
return IWAD_FreeDM;
}
else
{
return IWAD_FreeDoom;
}
}
else
{
return IWAD_Doom2;

View File

@ -368,6 +368,7 @@ AActor *P_CheckOnmobj (AActor *thing);
void P_FakeZMovement (AActor *mo);
bool P_TryMove (AActor* thing, fixed_t x, fixed_t y, bool dropoff, const secplane_t * onfloor, FCheckPosition &tm);
bool P_TryMove (AActor* thing, fixed_t x, fixed_t y, bool dropoff, const secplane_t * onfloor = NULL);
bool P_CheckMove(AActor *thing, fixed_t x, fixed_t y);
bool P_TeleportMove (AActor* thing, fixed_t x, fixed_t y, fixed_t z, bool telefrag); // [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);

View File

@ -220,12 +220,9 @@ void P_FindFloorCeiling (AActor *actor, bool onlyspawnpos)
fixed_t ff_bottom=rover->bottom.plane->ZatPoint(actor->x, actor->y);
fixed_t ff_top=rover->top.plane->ZatPoint(actor->x, actor->y);
fixed_t delta1 = actor->z - (ff_bottom + ((ff_top-ff_bottom)/2));
fixed_t delta2 = actor->z + (actor->height? actor->height:1) - (ff_bottom + ((ff_top-ff_bottom)/2));
if (ff_top > actor->floorz && abs(delta1) < abs(delta2)) actor->floorz = ff_top;
if (ff_bottom < actor->ceilingz && abs(delta1) >= abs(delta2)) actor->ceilingz = ff_bottom;
if (ff_top > actor->floorz && ff_top < actor->z) actor->floorz = ff_top;
if (ff_bottom < actor->ceilingz && ff_bottom > actor->z + actor->height) actor->ceilingz = ff_bottom;
}
}
#endif
@ -1773,6 +1770,90 @@ bool P_TryMove (AActor *thing, fixed_t x, fixed_t y,
//
// P_CheckMove
// Similar to P_TryMove but doesn't actually move the actor. Used for polyobject crushing
//
bool P_CheckMove(AActor *thing, fixed_t x, fixed_t y)
{
FCheckPosition tm;
fixed_t newz = thing->z;
int side;
int oldside;
line_t* ld;
sector_t* oldsec = thing->Sector; // [RH] for sector actions
sector_t* newsec;
if (!P_CheckPosition (thing, x, y, tm))
{
return false;
}
if (thing->flags3 & MF3_FLOORHUGGER)
{
newz = tm.floorz;
}
else if (thing->flags3 & MF3_CEILINGHUGGER)
{
newz = tm.ceilingz - thing->height;
}
if (!(thing->flags & MF_NOCLIP))
{
if (tm.ceilingz - tm.floorz < thing->height)
{
return false;
}
if (!(thing->flags & MF_TELEPORT)
&& tm.ceilingz - newz < thing->height
&& !(thing->flags3 & MF3_CEILINGHUGGER)
&& (!(thing->flags2 & MF2_FLY) || !(thing->flags & MF_NOGRAVITY)))
{
return false;
}
if (thing->flags2 & MF2_FLY && thing->flags & MF_NOGRAVITY)
{
if (thing->z+thing->height > tm.ceilingz)
return false;
}
if (!(thing->flags & MF_TELEPORT) && !(thing->flags3 & MF3_FLOORHUGGER))
{
if (tm.floorz-newz > thing->MaxStepHeight)
{ // too big a step up
return false;
}
else if ((thing->flags & MF_MISSILE) && tm.floorz > newz)
{ // [RH] Don't let normal missiles climb steps
return false;
}
else if (newz < tm.floorz)
{ // [RH] Check to make sure there's nothing in the way for the step up
fixed_t savedz = thing->z;
thing->z = newz = tm.floorz;
bool good = P_TestMobjZ (thing);
thing->z = savedz;
if (!good)
{
return false;
}
}
}
if (thing->flags2 & MF2_CANTLEAVEFLOORPIC
&& (tm.floorpic != thing->floorpic
|| tm.floorz - newz != 0))
{ // must stay within a sector of a certain floor type
return false;
}
}
return true;
}
//
// SLIDE MOVE
// Allows the player to slide along any angled walls.

View File

@ -774,7 +774,7 @@ void ThrustMobj (AActor *actor, seg_t *seg, FPolyObj *po)
actor->momy += thrustY;
if (po->crush)
{
if (po->bHurtOnTouch || !P_CheckPosition (actor, actor->x + thrustX, actor->y + thrustY))
if (po->bHurtOnTouch || !P_CheckMove (actor, actor->x + thrustX, actor->y + thrustY))
{
P_DamageMobj (actor, NULL, NULL, po->crush, NAME_Crush);
P_TraceBleed (po->crush, actor);

View File

@ -456,6 +456,7 @@ void DSectorPlaneInterpolation::Restore()
sector->ceilingplane.d = bakheight;
sector->SetPlaneTexZ(sector_t::ceiling, baktexz);
}
P_RecalculateAttached3DFloors(sector);
}
//==========================================================================
@ -485,6 +486,7 @@ void DSectorPlaneInterpolation::Interpolate(fixed_t smoothratio)
*pheight = oldheight + FixedMul(bakheight - oldheight, smoothratio);
sector->SetPlaneTexZ(pos, oldtexz + FixedMul(baktexz - oldtexz, smoothratio));
P_RecalculateAttached3DFloors(sector);
}
//==========================================================================