Guess what major breaking-news bug I just fixed B)

...

(It's that infamous intangible West/South linedefs bug, which was really a blockmap-related bug all along. AND IT WAS SO SIMPLE TO FIX!)

git-svn-id: https://code.orospakr.ca/svn/srb2/trunk@9048 6de4a73c-47e2-0310-b8c1-93d6ecd3f8cd
This commit is contained in:
MonsterIestyn 2015-02-20 22:58:55 +00:00 committed by Alam Ed Arias
parent bd5dcb0b0a
commit 9e306394dd
5 changed files with 50 additions and 50 deletions

View file

@ -1294,10 +1294,10 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
// based on their origin point, and can overlap // based on their origin point, and can overlap
// into adjacent blocks by up to MAXRADIUS units. // into adjacent blocks by up to MAXRADIUS units.
xl = (unsigned)(tmbbox[BOXLEFT] - bmaporgx - MAXRADIUS)>>MAPBLOCKSHIFT; xl = (tmbbox[BOXLEFT] - bmaporgx - MAXRADIUS)>>MAPBLOCKSHIFT;
xh = (unsigned)(tmbbox[BOXRIGHT] - bmaporgx + MAXRADIUS)>>MAPBLOCKSHIFT; xh = (tmbbox[BOXRIGHT] - bmaporgx + MAXRADIUS)>>MAPBLOCKSHIFT;
yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy - MAXRADIUS)>>MAPBLOCKSHIFT; yl = (tmbbox[BOXBOTTOM] - bmaporgy - MAXRADIUS)>>MAPBLOCKSHIFT;
yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy + MAXRADIUS)>>MAPBLOCKSHIFT; yh = (tmbbox[BOXTOP] - bmaporgy + MAXRADIUS)>>MAPBLOCKSHIFT;
#ifdef POLYOBJECTS #ifdef POLYOBJECTS
// Check polyobjects and see if tmfloorz/tmceilingz need to be altered // Check polyobjects and see if tmfloorz/tmceilingz need to be altered
@ -1511,10 +1511,10 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
// based on their origin point, and can overlap // based on their origin point, and can overlap
// into adjacent blocks by up to MAXRADIUS units. // into adjacent blocks by up to MAXRADIUS units.
xl = (unsigned)(tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT; xl = (tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT;
xh = (unsigned)(tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT; xh = (tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT;
yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT; yl = (tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT; yh = (tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
#ifdef POLYOBJECTS #ifdef POLYOBJECTS
// Check polyobjects and see if tmfloorz/tmceilingz need to be altered // Check polyobjects and see if tmfloorz/tmceilingz need to be altered
@ -1938,10 +1938,10 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
{ {
INT32 bx, by, xl, xh, yl, yh; INT32 bx, by, xl, xh, yl, yh;
yh = (unsigned)(thing->y + MAXRADIUS - bmaporgy)>>MAPBLOCKSHIFT; yh = (thing->y + MAXRADIUS - bmaporgy)>>MAPBLOCKSHIFT;
yl = (unsigned)(thing->y - MAXRADIUS - bmaporgy)>>MAPBLOCKSHIFT; yl = (thing->y - MAXRADIUS - bmaporgy)>>MAPBLOCKSHIFT;
xh = (unsigned)(thing->x + MAXRADIUS - bmaporgx)>>MAPBLOCKSHIFT; xh = (thing->x + MAXRADIUS - bmaporgx)>>MAPBLOCKSHIFT;
xl = (unsigned)(thing->x - MAXRADIUS - bmaporgx)>>MAPBLOCKSHIFT; xl = (thing->x - MAXRADIUS - bmaporgx)>>MAPBLOCKSHIFT;
stand = thing; stand = thing;
standx = x; standx = x;
@ -3024,10 +3024,10 @@ void P_RadiusAttack(mobj_t *spot, mobj_t *source, fixed_t damagedist)
fixed_t dist; fixed_t dist;
dist = FixedMul(damagedist, spot->scale) + MAXRADIUS; dist = FixedMul(damagedist, spot->scale) + MAXRADIUS;
yh = (unsigned)(spot->y + dist - bmaporgy)>>MAPBLOCKSHIFT; yh = (spot->y + dist - bmaporgy)>>MAPBLOCKSHIFT;
yl = (unsigned)(spot->y - dist - bmaporgy)>>MAPBLOCKSHIFT; yl = (spot->y - dist - bmaporgy)>>MAPBLOCKSHIFT;
xh = (unsigned)(spot->x + dist - bmaporgx)>>MAPBLOCKSHIFT; xh = (spot->x + dist - bmaporgx)>>MAPBLOCKSHIFT;
xl = (unsigned)(spot->x - dist - bmaporgx)>>MAPBLOCKSHIFT; xl = (spot->x - dist - bmaporgx)>>MAPBLOCKSHIFT;
bombspot = spot; bombspot = spot;
bombsource = source; bombsource = source;
@ -3645,10 +3645,10 @@ void P_CreateSecNodeList(mobj_t *thing, fixed_t x, fixed_t y)
validcount++; // used to make sure we only process a line once validcount++; // used to make sure we only process a line once
xl = (unsigned)(tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT; xl = (tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT;
xh = (unsigned)(tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT; xh = (tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT;
yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT; yl = (tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT; yh = (tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
for (bx = xl; bx <= xh; bx++) for (bx = xl; bx <= xh; bx++)
for (by = yl; by <= yh; by++) for (by = yl; by <= yh; by++)
@ -3722,10 +3722,10 @@ void P_CreatePrecipSecNodeList(precipmobj_t *thing,fixed_t x,fixed_t y)
validcount++; // used to make sure we only process a line once validcount++; // used to make sure we only process a line once
xl = (unsigned)(preciptmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT; xl = (preciptmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT;
xh = (unsigned)(preciptmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT; xh = (preciptmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT;
yl = (unsigned)(preciptmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT; yl = (preciptmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
yh = (unsigned)(preciptmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT; yh = (preciptmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
for (bx = xl; bx <= xh; bx++) for (bx = xl; bx <= xh; bx++)
for (by = yl; by <= yh; by++) for (by = yl; by <= yh; by++)

View file

@ -768,8 +768,8 @@ void P_SetThingPosition(mobj_t *thing)
if (!(thing->flags & MF_NOBLOCKMAP)) if (!(thing->flags & MF_NOBLOCKMAP))
{ {
// inert things don't need to be in blockmap // inert things don't need to be in blockmap
const INT32 blockx = (unsigned)(thing->x - bmaporgx)>>MAPBLOCKSHIFT; const INT32 blockx = (thing->x - bmaporgx)>>MAPBLOCKSHIFT;
const INT32 blocky = (unsigned)(thing->y - bmaporgy)>>MAPBLOCKSHIFT; const INT32 blocky = (thing->y - bmaporgy)>>MAPBLOCKSHIFT;
if (blockx >= 0 && blockx < bmapwidth if (blockx >= 0 && blockx < bmapwidth
&& blocky >= 0 && blocky < bmapheight) && blocky >= 0 && blocky < bmapheight)
{ {
@ -1271,10 +1271,10 @@ boolean P_RadiusLinesCheck(fixed_t radius, fixed_t x, fixed_t y,
tmbbox[BOXLEFT] = x - radius; tmbbox[BOXLEFT] = x - radius;
// check lines // check lines
xl = (unsigned)(tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT; xl = (tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT;
xh = (unsigned)(tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT; xh = (tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT;
yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT; yl = (tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT; yh = (tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
for (bx = xl; bx <= xh; bx++) for (bx = xl; bx <= xh; bx++)
for (by = yl; by <= yh; by++) for (by = yl; by <= yh; by++)

View file

@ -851,10 +851,10 @@ static void Polyobj_linkToBlockmap(polyobj_t *po)
M_AddToBox(blockbox, po->vertices[i]->x, po->vertices[i]->y); M_AddToBox(blockbox, po->vertices[i]->x, po->vertices[i]->y);
// adjust bounding box relative to blockmap // adjust bounding box relative to blockmap
blockbox[BOXRIGHT] = (unsigned)(blockbox[BOXRIGHT] - bmaporgx) >> MAPBLOCKSHIFT; blockbox[BOXRIGHT] = (blockbox[BOXRIGHT] - bmaporgx) >> MAPBLOCKSHIFT;
blockbox[BOXLEFT] = (unsigned)(blockbox[BOXLEFT] - bmaporgx) >> MAPBLOCKSHIFT; blockbox[BOXLEFT] = (blockbox[BOXLEFT] - bmaporgx) >> MAPBLOCKSHIFT;
blockbox[BOXTOP] = (unsigned)(blockbox[BOXTOP] - bmaporgy) >> MAPBLOCKSHIFT; blockbox[BOXTOP] = (blockbox[BOXTOP] - bmaporgy) >> MAPBLOCKSHIFT;
blockbox[BOXBOTTOM] = (unsigned)(blockbox[BOXBOTTOM] - bmaporgy) >> MAPBLOCKSHIFT; blockbox[BOXBOTTOM] = (blockbox[BOXBOTTOM] - bmaporgy) >> MAPBLOCKSHIFT;
// link polyobject to every block its bounding box intersects // link polyobject to every block its bounding box intersects
for (y = blockbox[BOXBOTTOM]; y <= blockbox[BOXTOP]; ++y) for (y = blockbox[BOXBOTTOM]; y <= blockbox[BOXTOP]; ++y)
@ -1081,10 +1081,10 @@ static INT32 Polyobj_clipThings(polyobj_t *po, line_t *line)
return hitflags; return hitflags;
// adjust linedef bounding box to blockmap, extend by MAXRADIUS // adjust linedef bounding box to blockmap, extend by MAXRADIUS
linebox[BOXLEFT] = (unsigned)(line->bbox[BOXLEFT] - bmaporgx - MAXRADIUS) >> MAPBLOCKSHIFT; linebox[BOXLEFT] = (line->bbox[BOXLEFT] - bmaporgx - MAXRADIUS) >> MAPBLOCKSHIFT;
linebox[BOXRIGHT] = (unsigned)(line->bbox[BOXRIGHT] - bmaporgx + MAXRADIUS) >> MAPBLOCKSHIFT; linebox[BOXRIGHT] = (line->bbox[BOXRIGHT] - bmaporgx + MAXRADIUS) >> MAPBLOCKSHIFT;
linebox[BOXBOTTOM] = (unsigned)(line->bbox[BOXBOTTOM] - bmaporgy - MAXRADIUS) >> MAPBLOCKSHIFT; linebox[BOXBOTTOM] = (line->bbox[BOXBOTTOM] - bmaporgy - MAXRADIUS) >> MAPBLOCKSHIFT;
linebox[BOXTOP] = (unsigned)(line->bbox[BOXTOP] - bmaporgy + MAXRADIUS) >> MAPBLOCKSHIFT; linebox[BOXTOP] = (line->bbox[BOXTOP] - bmaporgy + MAXRADIUS) >> MAPBLOCKSHIFT;
// check all mobj blockmap cells the line contacts // check all mobj blockmap cells the line contacts
for (y = linebox[BOXBOTTOM]; y <= linebox[BOXTOP]; ++y) for (y = linebox[BOXBOTTOM]; y <= linebox[BOXTOP]; ++y)

View file

@ -7401,10 +7401,10 @@ void T_Pusher(pusher_t *p)
tmbbox[BOXRIGHT] = p->x + radius; tmbbox[BOXRIGHT] = p->x + radius;
tmbbox[BOXLEFT] = p->x - radius; tmbbox[BOXLEFT] = p->x - radius;
xl = (unsigned)(tmbbox[BOXLEFT] - bmaporgx - MAXRADIUS)>>MAPBLOCKSHIFT; xl = (tmbbox[BOXLEFT] - bmaporgx - MAXRADIUS)>>MAPBLOCKSHIFT;
xh = (unsigned)(tmbbox[BOXRIGHT] - bmaporgx + MAXRADIUS)>>MAPBLOCKSHIFT; xh = (tmbbox[BOXRIGHT] - bmaporgx + MAXRADIUS)>>MAPBLOCKSHIFT;
yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy - MAXRADIUS)>>MAPBLOCKSHIFT; yl = (tmbbox[BOXBOTTOM] - bmaporgy - MAXRADIUS)>>MAPBLOCKSHIFT;
yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy + MAXRADIUS)>>MAPBLOCKSHIFT; yh = (tmbbox[BOXTOP] - bmaporgy + MAXRADIUS)>>MAPBLOCKSHIFT;
for (bx = xl; bx <= xh; bx++) for (bx = xl; bx <= xh; bx++)
for (by = yl; by <= yh; by++) for (by = yl; by <= yh; by++)
P_BlockThingsIterator(bx,by, PIT_PushThing); P_BlockThingsIterator(bx,by, PIT_PushThing);

View file

@ -2958,10 +2958,10 @@ static void P_DoTeeter(player_t *player)
{ {
INT32 bx, by, xl, xh, yl, yh; INT32 bx, by, xl, xh, yl, yh;
yh = (unsigned)(player->mo->y + player->mo->radius - bmaporgy)>>MAPBLOCKSHIFT; yh = (player->mo->y + player->mo->radius - bmaporgy)>>MAPBLOCKSHIFT;
yl = (unsigned)(player->mo->y - player->mo->radius - bmaporgy)>>MAPBLOCKSHIFT; yl = (player->mo->y - player->mo->radius - bmaporgy)>>MAPBLOCKSHIFT;
xh = (unsigned)(player->mo->x + player->mo->radius - bmaporgx)>>MAPBLOCKSHIFT; xh = (player->mo->x + player->mo->radius - bmaporgx)>>MAPBLOCKSHIFT;
xl = (unsigned)(player->mo->x - player->mo->radius - bmaporgx)>>MAPBLOCKSHIFT; xl = (player->mo->x - player->mo->radius - bmaporgx)>>MAPBLOCKSHIFT;
// Polyobjects // Polyobjects
#ifdef POLYOBJECTS #ifdef POLYOBJECTS
@ -8094,10 +8094,10 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
INT32 xl, xh, yl, yh, bx, by; INT32 xl, xh, yl, yh, bx, by;
validcount++; validcount++;
xl = (unsigned)(tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT; xl = (tmbbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT;
xh = (unsigned)(tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT; xh = (tmbbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT;
yl = (unsigned)(tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT; yl = (tmbbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
yh = (unsigned)(tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT; yh = (tmbbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
for (by = yl; by <= yh; by++) for (by = yl; by <= yh; by++)
for (bx = xl; bx <= xh; bx++) for (bx = xl; bx <= xh; bx++)