- Fixed: EV_DoDonut, EV_DoElevator and EV_StartWaggle did not to any 0-tag checks.

SVN r2000 (trunk)
This commit is contained in:
Christoph Oelckers 2009-11-24 07:38:11 +00:00
parent a3c28e2a2f
commit 233e662a92
4 changed files with 50 additions and 11 deletions

View file

@ -1,4 +1,6 @@
November 24, 2009 (Changes by Graf Zahl) November 24, 2009 (Changes by Graf Zahl)
- Fixed: EV_DoDonut, EV_DoElevator and EV_StartWaggle did not to any 0-tag
checks.
- Fixed: Doom line type 44 (lower ceiling to 8 above floor) must halt - Fixed: Doom line type 44 (lower ceiling to 8 above floor) must halt
movement if blocked which essentially means it acts like a Hexen-style movement if blocked which essentially means it acts like a Hexen-style
crusher. crusher.

View file

@ -770,7 +770,7 @@ manual_stair:
// //
//========================================================================== //==========================================================================
bool EV_DoDonut (int tag, fixed_t pillarspeed, fixed_t slimespeed) bool EV_DoDonut (int tag, line_t *line, fixed_t pillarspeed, fixed_t slimespeed)
{ {
sector_t* s1; sector_t* s1;
sector_t* s2; sector_t* s2;
@ -781,13 +781,24 @@ bool EV_DoDonut (int tag, fixed_t pillarspeed, fixed_t slimespeed)
DFloor* floor; DFloor* floor;
vertex_t* spot; vertex_t* spot;
fixed_t height; fixed_t height;
bool manual = false;
secnum = -1; secnum = -1;
rtn = false; rtn = false;
if (tag == 0)
{
if (!line || !(s1 = line->backsector))
return rtn;
manual = true;
goto manual_donut;
}
while ((secnum = P_FindSectorFromTag(tag,secnum)) >= 0) while ((secnum = P_FindSectorFromTag(tag,secnum)) >= 0)
{ {
s1 = &sectors[secnum]; // s1 is pillar's sector s1 = &sectors[secnum]; // s1 is pillar's sector
manual_donut:
// ALREADY MOVING? IF SO, KEEP GOING... // ALREADY MOVING? IF SO, KEEP GOING...
if (s1->PlaneMoving(sector_t::floor)) if (s1->PlaneMoving(sector_t::floor))
continue; continue;
@ -834,6 +845,7 @@ bool EV_DoDonut (int tag, fixed_t pillarspeed, fixed_t slimespeed)
floor->StartFloorSound (); floor->StartFloorSound ();
break; break;
} }
if (manual) break;
} }
return rtn; return rtn;
} }
@ -989,17 +1001,28 @@ bool EV_DoElevator (line_t *line, DElevator::EElevator elevtype,
fixed_t floorheight, ceilingheight; fixed_t floorheight, ceilingheight;
fixed_t newheight; fixed_t newheight;
vertex_t* spot; vertex_t* spot;
bool manual = false;
if (!line && (elevtype == DElevator::elevateCurrent)) if (!line && (elevtype == DElevator::elevateCurrent))
return false; return false;
secnum = -1; secnum = -1;
rtn = false; rtn = false;
if (tag == 0)
{
if (!line || !(sec = line->backsector))
return rtn;
manual = true;
goto manual_elevator;
}
// act on all sectors with the same tag as the triggering linedef // act on all sectors with the same tag as the triggering linedef
while ((secnum = P_FindSectorFromTag (tag, secnum)) >= 0) while ((secnum = P_FindSectorFromTag (tag, secnum)) >= 0)
{ {
sec = &sectors[secnum]; sec = &sectors[secnum];
manual_elevator:
// If either floor or ceiling is already activated, skip it // If either floor or ceiling is already activated, skip it
if (sec->PlaneMoving(sector_t::floor) || sec->ceilingdata) //jff 2/22/98 if (sec->PlaneMoving(sector_t::floor) || sec->ceilingdata) //jff 2/22/98
continue; continue;
@ -1060,6 +1083,7 @@ bool EV_DoElevator (line_t *line, DElevator::EElevator elevtype,
elevator->m_CeilingDestDist = sec->ceilingplane.PointToDist (sec->soundorg[0], sec->soundorg[1], ceilingheight - height); elevator->m_CeilingDestDist = sec->ceilingplane.PointToDist (sec->soundorg[0], sec->soundorg[1], ceilingheight - height);
break; break;
} }
if (manual) break;
} }
return rtn; return rtn;
} }
@ -1307,19 +1331,31 @@ void DCeilingWaggle::Tick ()
// //
//========================================================================== //==========================================================================
bool EV_StartWaggle (int tag, int height, int speed, int offset, bool EV_StartWaggle (int tag, line_t *line, int height, int speed, int offset,
int timer, bool ceiling) int timer, bool ceiling)
{ {
int sectorIndex; int sectorIndex;
sector_t *sector; sector_t *sector;
DWaggleBase *waggle; DWaggleBase *waggle;
bool retCode; bool retCode;
bool manual = false;
retCode = false; retCode = false;
sectorIndex = -1; sectorIndex = -1;
if (tag == 0)
{
if (!line || !(sector = line->backsector))
return retCode;
manual = true;
goto manual_waggle;
}
while ((sectorIndex = P_FindSectorFromTag(tag, sectorIndex)) >= 0) while ((sectorIndex = P_FindSectorFromTag(tag, sectorIndex)) >= 0)
{ {
sector = &sectors[sectorIndex]; sector = &sectors[sectorIndex];
manual_waggle:
if ((!ceiling && sector->PlaneMoving(sector_t::floor)) || if ((!ceiling && sector->PlaneMoving(sector_t::floor)) ||
(ceiling && sector->PlaneMoving(sector_t::ceiling))) (ceiling && sector->PlaneMoving(sector_t::ceiling)))
{ // Already busy with another thinker { // Already busy with another thinker
@ -1344,6 +1380,7 @@ bool EV_StartWaggle (int tag, int height, int speed, int offset,
/(TICRATE+((3*TICRATE)*height)/255); /(TICRATE+((3*TICRATE)*height)/255);
waggle->m_Ticker = timer ? timer*TICRATE : -1; waggle->m_Ticker = timer ? timer*TICRATE : -1;
waggle->m_State = WGLSTATE_EXPAND; waggle->m_State = WGLSTATE_EXPAND;
if (manual) break;
} }
return retCode; return retCode;
} }

View file

@ -341,13 +341,13 @@ FUNC(LS_Floor_LowerToLowestTxTy)
FUNC(LS_Floor_Waggle) FUNC(LS_Floor_Waggle)
// Floor_Waggle (tag, amplitude, frequency, delay, time) // Floor_Waggle (tag, amplitude, frequency, delay, time)
{ {
return EV_StartWaggle (arg0, arg1, arg2, arg3, arg4, false); return EV_StartWaggle (arg0, ln, arg1, arg2, arg3, arg4, false);
} }
FUNC(LS_Ceiling_Waggle) FUNC(LS_Ceiling_Waggle)
// Ceiling_Waggle (tag, amplitude, frequency, delay, time) // Ceiling_Waggle (tag, amplitude, frequency, delay, time)
{ {
return EV_StartWaggle (arg0, arg1, arg2, arg3, arg4, true); return EV_StartWaggle (arg0, ln, arg1, arg2, arg3, arg4, true);
} }
FUNC(LS_Floor_TransferTrigger) FUNC(LS_Floor_TransferTrigger)
@ -365,7 +365,7 @@ FUNC(LS_Floor_TransferNumeric)
FUNC(LS_Floor_Donut) FUNC(LS_Floor_Donut)
// Floor_Donut (pillartag, pillarspeed, slimespeed) // Floor_Donut (pillartag, pillarspeed, slimespeed)
{ {
return EV_DoDonut (arg0, SPEED(arg1), SPEED(arg2)); return EV_DoDonut (arg0, ln, SPEED(arg1), SPEED(arg2));
} }
FUNC(LS_Generic_Floor) FUNC(LS_Generic_Floor)

View file

@ -825,7 +825,7 @@ protected:
friend bool EV_DoFloor (DFloor::EFloor floortype, line_t *line, int tag, friend bool EV_DoFloor (DFloor::EFloor floortype, line_t *line, int tag,
fixed_t speed, fixed_t height, int crush, int change, bool hexencrush); fixed_t speed, fixed_t height, int crush, int change, bool hexencrush);
friend bool EV_FloorCrushStop (int tag); friend bool EV_FloorCrushStop (int tag);
friend bool EV_DoDonut (int tag, fixed_t pillarspeed, fixed_t slimespeed); friend bool EV_DoDonut (int tag, line_t *line, fixed_t pillarspeed, fixed_t slimespeed);
private: private:
DFloor (); DFloor ();
}; };
@ -836,7 +836,7 @@ bool EV_BuildStairs (int tag, DFloor::EStair type, line_t *line,
bool EV_DoFloor (DFloor::EFloor floortype, line_t *line, int tag, bool EV_DoFloor (DFloor::EFloor floortype, line_t *line, int tag,
fixed_t speed, fixed_t height, int crush, int change, bool hexencrush); fixed_t speed, fixed_t height, int crush, int change, bool hexencrush);
bool EV_FloorCrushStop (int tag); bool EV_FloorCrushStop (int tag);
bool EV_DoDonut (int tag, fixed_t pillarspeed, fixed_t slimespeed); bool EV_DoDonut (int tag, line_t *line, fixed_t pillarspeed, fixed_t slimespeed);
inline FArchive &operator<< (FArchive &arc, DFloor::EFloor &type) inline FArchive &operator<< (FArchive &arc, DFloor::EFloor &type)
{ {
@ -915,7 +915,7 @@ protected:
int m_State; int m_State;
TObjPtr<DInterpolation> m_Interpolation; TObjPtr<DInterpolation> m_Interpolation;
friend bool EV_StartWaggle (int tag, int height, int speed, friend bool EV_StartWaggle (int tag, line_t *line, int height, int speed,
int offset, int timer, bool ceiling); int offset, int timer, bool ceiling);
void DoWaggle (bool ceiling); void DoWaggle (bool ceiling);
@ -923,7 +923,7 @@ protected:
DWaggleBase (); DWaggleBase ();
}; };
bool EV_StartWaggle (int tag, int height, int speed, bool EV_StartWaggle (int tag, line_t *line, int height, int speed,
int offset, int timer, bool ceiling); int offset, int timer, bool ceiling);
class DFloorWaggle : public DWaggleBase class DFloorWaggle : public DWaggleBase