- did the last remaining bits in p_map.cpp.

This commit is contained in:
Christoph Oelckers 2016-03-27 22:49:59 +02:00
parent 8b4a33794a
commit 7b256dda3d
3 changed files with 14 additions and 20 deletions

View File

@ -432,7 +432,7 @@ void P_RadiusAttack (AActor *spot, AActor *source, int damage, int distance,
void P_DelSector_List(); void P_DelSector_List();
void P_DelSeclist(msecnode_t *); // phares 3/16/98 void P_DelSeclist(msecnode_t *); // phares 3/16/98
msecnode_t* P_DelSecnode(msecnode_t *); msecnode_t* P_DelSecnode(msecnode_t *);
void P_CreateSecNodeList(AActor*,fixed_t,fixed_t); // phares 3/14/98 void P_CreateSecNodeList(AActor*); // phares 3/14/98
double P_GetMoveFactor(const AActor *mo, double *frictionp); // phares 3/6/98 double P_GetMoveFactor(const AActor *mo, double *frictionp); // phares 3/6/98
double P_GetFriction(const AActor *mo, double *frictionfactor); double P_GetFriction(const AActor *mo, double *frictionfactor);
bool Check_Sides(AActor *, int, int); // phares bool Check_Sides(AActor *, int, int); // phares

View File

@ -678,7 +678,7 @@ static int LineIsBelow(line_t *line, AActor *actor)
// //
// //
// PIT_CheckLine // PIT_CheckLine
// Adjusts tmfloorz and tm_f_ceilingz() as lines are contacted // Adjusts tmfloorz and tmceilingz as lines are contacted
// //
// //
//========================================================================== //==========================================================================
@ -2593,7 +2593,7 @@ void FSlide::HitSlideLine(line_t* ld)
moveangle = tmmove.Angle(); moveangle = tmmove.Angle();
// prevents sudden path reversal due to rounding error | // phares // prevents sudden path reversal due to rounding error | // phares
moveangle += 3600/65536.*65536.; // Boom added 10 to the angle_t here. moveangle += 3600/65536.*65536.; // Boom added 10 to the angle here.
deltaangle = ::deltaangle(lineangle, moveangle); // V deltaangle = ::deltaangle(lineangle, moveangle); // V
movelen = tmmove.Length(); movelen = tmmove.Length();
@ -2820,7 +2820,7 @@ retry:
} }
// fudge a bit to make sure it doesn't hit // fudge a bit to make sure it doesn't hit
bestSlidefrac -= FRACUNIT / 32; bestSlidefrac -= 1. / 32;
if (bestSlidefrac > 0) if (bestSlidefrac > 0)
{ {
newpos = tryp * bestSlidefrac; newpos = tryp * bestSlidefrac;
@ -3037,13 +3037,13 @@ bool FSlide::BounceTraverse(const DVector2 &start, const DVector2 &end)
} }
if (!(li->flags&ML_TWOSIDED) || !li->backsector) if (!(li->flags&ML_TWOSIDED) || !li->backsector)
{ {
if (P_PointOnLineSide(slidemo->_f_X(), slidemo->_f_Y(), li)) if (P_PointOnLineSide(slidemo->Pos(), li))
continue; // don't hit the back side continue; // don't hit the back side
goto bounceblocking; goto bounceblocking;
} }
P_LineOpening(open, slidemo, li, it._f_InterceptPoint(in)); // set openrange, opentop, openbottom P_LineOpening(open, slidemo, li, it.InterceptPoint(in)); // set openrange, opentop, openbottom
if (open.range < slidemo->Height) if (open.range < slidemo->Height)
goto bounceblocking; // doesn't fit goto bounceblocking; // doesn't fit
@ -3215,7 +3215,7 @@ bool P_BounceActor(AActor *mo, AActor *BlockingMobj, bool ontop)
{ {
DAngle angle = BlockingMobj->AngleTo(mo) + ((pr_bounce() % 16) - 8); DAngle angle = BlockingMobj->AngleTo(mo) + ((pr_bounce() % 16) - 8);
double speed = mo->VelXYToSpeed() * mo->wallbouncefactor; // [GZ] was 0.75, using wallbouncefactor seems more consistent double speed = mo->VelXYToSpeed() * mo->wallbouncefactor; // [GZ] was 0.75, using wallbouncefactor seems more consistent
mo->Angles.Yaw = ANGLE2DBL(angle); mo->Angles.Yaw = angle;
mo->VelFromAngle(speed); mo->VelFromAngle(speed);
mo->PlayBounceSound(true); mo->PlayBounceSound(true);
if (mo->BounceFlags & BOUNCE_UseBounceState) if (mo->BounceFlags & BOUNCE_UseBounceState)
@ -4366,7 +4366,7 @@ void P_TraceBleed(int damage, const DVector3 &pos, AActor *actor, DAngle angle,
double cosp = bleedpitch.Cos(); double cosp = bleedpitch.Cos();
DVector3 vdir = DVector3(cosp * bleedang.Cos(), cosp * bleedang.Sin(), -bleedpitch.Sin()); DVector3 vdir = DVector3(cosp * bleedang.Cos(), cosp * bleedang.Sin(), -bleedpitch.Sin());
if (Trace(pos, actor->Sector, vdir, 172 * FRACUNIT, 0, ML_BLOCKEVERYTHING, actor, bleedtrace, TRACE_NoSky)) if (Trace(pos, actor->Sector, vdir, 172, 0, ML_BLOCKEVERYTHING, actor, bleedtrace, TRACE_NoSky))
{ {
if (bleedtrace.HitType == TRACE_HitWall) if (bleedtrace.HitType == TRACE_HitWall)
{ {
@ -4619,7 +4619,7 @@ void P_RailAttack(FRailParams *p)
if (bleed) if (bleed)
{ {
P_SpawnBlood(hitpos, hitangle, newdam > 0 ? newdam : p->damage, hitactor); P_SpawnBlood(hitpos, hitangle, newdam > 0 ? newdam : p->damage, hitactor);
P_TraceBleed(newdam > 0 ? newdam : p->damage, hitpos, hitactor, hitangle, ANGLE2DBL(pitch)); P_TraceBleed(newdam > 0 ? newdam : p->damage, hitpos, hitactor, hitangle, pitch);
} }
} }
@ -5059,7 +5059,7 @@ void P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bo
while ((it.Next(&cres))) while ((it.Next(&cres)))
{ {
AActor *thing = cres.thing; AActor *thing = cres.thing;
// Vulnerable actors can be damaged by _f_radius() attacks even if not shootable // Vulnerable actors can be damaged by radius attacks even if not shootable
// Used to emulate MBF's vulnerability of non-missile bouncers to explosions. // Used to emulate MBF's vulnerability of non-missile bouncers to explosions.
if (!((thing->flags & MF_SHOOTABLE) || (thing->flags6 & MF6_VULNERABLE))) if (!((thing->flags & MF_SHOOTABLE) || (thing->flags6 & MF6_VULNERABLE)))
continue; continue;
@ -6122,7 +6122,7 @@ void P_DelSeclist(msecnode_t *node)
// //
//============================================================================= //=============================================================================
void P_CreateSecNodeList(AActor *thing, fixed_t x, fixed_t y) void P_CreateSecNodeList(AActor *thing)
{ {
msecnode_t *node; msecnode_t *node;
@ -6138,19 +6138,13 @@ void P_CreateSecNodeList(AActor *thing, fixed_t x, fixed_t y)
node = node->m_tnext; node = node->m_tnext;
} }
FBoundingBox box(thing->_f_X(), thing->_f_Y(), thing->_f_radius()); FBoundingBox box(thing->X(), thing->Y(), thing->radius);
FBlockLinesIterator it(box); FBlockLinesIterator it(box);
line_t *ld; line_t *ld;
while ((ld = it.Next())) while ((ld = it.Next()))
{ {
if (box.Right() <= ld->bbox[BOXLEFT] || if (!box.inRange(ld) || box.BoxOnLineSide(ld) != -1)
box.Left() >= ld->bbox[BOXRIGHT] ||
box.Top() <= ld->bbox[BOXBOTTOM] ||
box.Bottom() >= ld->bbox[BOXTOP])
continue;
if (box.BoxOnLineSide(ld) != -1)
continue; continue;
// This line crosses through the object. // This line crosses through the object.

View File

@ -505,7 +505,7 @@ void AActor::LinkToWorld(bool spawningmapthing, sector_t *sector)
// When a node is deleted, its sector links (the links starting // When a node is deleted, its sector links (the links starting
// at sector_t->touching_thinglist) are broken. When a node is // at sector_t->touching_thinglist) are broken. When a node is
// added, new sector links are created. // added, new sector links are created.
P_CreateSecNodeList(this, _f_X(), _f_Y()); P_CreateSecNodeList(this);
touching_sectorlist = sector_list; // Attach to thing touching_sectorlist = sector_list; // Attach to thing
sector_list = NULL; // clear for next time sector_list = NULL; // clear for next time
} }