* Updated to ZDoom r2342:

- fixed: Heretic's 666 lower floor must be of type LowerToHighest unlike Doom which is LowerToLowest.
- restored original Doom behavior for hitscans to only check actors which have their center in the blockmap cells being checked, compatibility optioned by COMPATF_HITSCAN.
- added a Boom (strict) compatibility mode.
- Restored some original Doom behavior that received complaints from users:
* reactivated the old sliding against diagonal walls code and compatibility optioned it with COMPATF_WALLRUN.
* re-added the original hitscan checking code using a cross-section of the actor instead of the bounding box, compatibility optioned with COMPATF_HITSCAN.

git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@804 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
gez 2010-05-28 23:10:08 +00:00
parent 01478776ac
commit 08ebe42674
15 changed files with 266 additions and 182 deletions

View file

@ -1276,10 +1276,6 @@ bool P_CheckPosition (AActor *thing, fixed_t x, fixed_t y, FCheckPosition &tm)
return true;
// Check things first, possibly picking things up.
// The bounding box is extended by MAXRADIUS
// because DActors are grouped into mapblocks
// based on their origin point, and can overlap
// into adjacent blocks by up to MAXRADIUS units.
thing->BlockingMobj = NULL;
thingblocker = NULL;
fakedblocker = NULL;
@ -2183,48 +2179,53 @@ void FSlide::HitSlideLine (line_t* ld)
} // ^
else // |
{ // phares
#if 0
fixed_t newlen;
if (deltaangle > ANG180)
deltaangle += ANG180;
// I_Error ("SlideLine: ang>ANG180");
lineangle >>= ANGLETOFINESHIFT;
deltaangle >>= ANGLETOFINESHIFT;
newlen = FixedMul (movelen, finecosine[deltaangle]);
tmxmove = FixedMul (newlen, finecosine[lineangle]);
tmymove = FixedMul (newlen, finesine[lineangle]);
#else
divline_t dll, dlv;
fixed_t inter1, inter2, inter3;
P_MakeDivline (ld, &dll);
dlv.x = slidemo->x;
dlv.y = slidemo->y;
dlv.dx = dll.dy;
dlv.dy = -dll.dx;
inter1 = P_InterceptVector(&dll, &dlv);
dlv.dx = tmxmove;
dlv.dy = tmymove;
inter2 = P_InterceptVector (&dll, &dlv);
inter3 = P_InterceptVector (&dlv, &dll);
if (inter3 != 0)
// Doom's original algorithm here does not work well due to imprecisions of the sine table.
// However, keep it active if the wallrunning compatibility flag is on
if (i_compatflags & COMPATF_WALLRUN)
{
tmxmove = Scale (inter2-inter1, dll.dx, inter3);
tmymove = Scale (inter2-inter1, dll.dy, inter3);
fixed_t newlen;
if (deltaangle > ANG180)
deltaangle += ANG180;
// I_Error ("SlideLine: ang>ANG180");
lineangle >>= ANGLETOFINESHIFT;
deltaangle >>= ANGLETOFINESHIFT;
newlen = FixedMul (movelen, finecosine[deltaangle]);
tmxmove = FixedMul (newlen, finecosine[lineangle]);
tmymove = FixedMul (newlen, finesine[lineangle]);
}
else
{
tmxmove = tmymove = 0;
divline_t dll, dlv;
fixed_t inter1, inter2, inter3;
P_MakeDivline (ld, &dll);
dlv.x = slidemo->x;
dlv.y = slidemo->y;
dlv.dx = dll.dy;
dlv.dy = -dll.dx;
inter1 = P_InterceptVector(&dll, &dlv);
dlv.dx = tmxmove;
dlv.dy = tmymove;
inter2 = P_InterceptVector (&dll, &dlv);
inter3 = P_InterceptVector (&dlv, &dll);
if (inter3 != 0)
{
tmxmove = Scale (inter2-inter1, dll.dx, inter3);
tmymove = Scale (inter2-inter1, dll.dy, inter3);
}
else
{
tmxmove = tmymove = 0;
}
}
#endif
} // phares
}
@ -2938,7 +2939,7 @@ bool aim_t::AimTraverse3DFloors(const divline_t &trace, intercept_t * in)
void aim_t::AimTraverse (fixed_t startx, fixed_t starty, fixed_t endx, fixed_t endy, AActor *target)
{
FPathTraverse it(startx, starty, endx, endy, PT_ADDLINES|PT_ADDTHINGS);
FPathTraverse it(startx, starty, endx, endy, PT_ADDLINES|PT_ADDTHINGS|PT_COMPATIBLE);
intercept_t *in;
while ((in = it.Next()))
@ -3421,9 +3422,12 @@ AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance,
(t1->player->ReadyWeapon->WeaponFlags & WIF_AXEBLOOD));
// Hit a thing, so it could be either a puff or blood
hitx = t1->x + FixedMul (vx, trace.Distance);
hity = t1->y + FixedMul (vy, trace.Distance);
hitz = shootz + FixedMul (vz, trace.Distance);
fixed_t dist = trace.Distance;
// position a bit closer for puffs/blood if using compatibility mode.
if (i_compatflags & COMPATF_HITSCAN) dist -= 10*FRACUNIT;
hitx = t1->x + FixedMul (vx, dist);
hity = t1->y + FixedMul (vy, dist);
hitz = shootz + FixedMul (vz, dist);
// Spawn bullet puffs or blood spots, depending on target type.
if ((puffDefaults->flags3 & MF3_PUFFONACTORS) ||