p_move.c
//
// This is purely informative, nothing is modified (except things picked up)
//
This is purely informative, nothing is modified (except things picked up)
This is purely informative nothing is modified ( except things picked up )
static void PM_CheckPosition(void)
{
   int xl, xh, yl, yh, bx, by;
   tmflags = tmthing->flags;
   tmbbox[BOXTOP   ] = tmy + tmthing->radius;
   tmbbox[BOXBOTTOM] = tmy - tmthing->radius;
   tmbbox[BOXRIGHT ] = tmx + tmthing->radius;
   tmbbox[BOXLEFT  ] = tmx - tmthing->radius;
   newsubsec = R_PointInSubsector(tmx, tmy);
   tmfloorz   = tmdropoffz = newsubsec->sector->floorheight;
   tmceilingz = newsubsec->sector->ceilingheight;
   ++validcount;
   movething = NULL;
   blockline = NULL;
   if(tmflags & MF_NOCLIP) 
   {
      trymove2 = true;
      return;
   }
   xl = (tmbbox[BOXLEFT  ] - bmaporgx - MAXRADIUS) >> MAPBLOCKSHIFT;
   xh = (tmbbox[BOXRIGHT ] - bmaporgx + MAXRADIUS) >> MAPBLOCKSHIFT;
   yl = (tmbbox[BOXBOTTOM] - bmaporgy - MAXRADIUS) >> MAPBLOCKSHIFT;
   yh = (tmbbox[BOXTOP   ] - bmaporgy + MAXRADIUS) >> MAPBLOCKSHIFT;
   if(xl < 0)
      xl = 0;
   if(yl < 0)
      yl = 0;
   if(xh >= bmapwidth)
      xh = bmapwidth - 1;
   if(yh >= bmapheight)
      yh = bmapheight - 1;
   for(bx = xl; bx <= xh; bx++)
   {
      for(by = yl; by <= yh; by++)
      {
         if(!P_BlockThingsIterator(bx, by, PIT_CheckThing))
         {
            trymove2 = false;
            return;
         }
      }
   }
   xl = (tmbbox[BOXLEFT  ] - bmaporgx) >> MAPBLOCKSHIFT;
   xh = (tmbbox[BOXRIGHT ] - bmaporgx) >> MAPBLOCKSHIFT;
   yl = (tmbbox[BOXBOTTOM] - bmaporgy) >> MAPBLOCKSHIFT;
   yh = (tmbbox[BOXTOP   ] - bmaporgy) >> MAPBLOCKSHIFT;
   if(xl < 0)
      xl = 0;
   if(yl < 0)
      yl = 0;
   if(xh >= bmapwidth)
      xh = bmapwidth - 1;
   if(yh >= bmapheight)
      yh = bmapheight - 1;
   for(bx = xl; bx <= xh; bx++)
   {
      for(by = yl; by <= yh; by++)
      {
         if(!P_BlockLinesIterator(bx, by, PM_CrossCheck))
         {
            trymove2 = false;
            return;
         }
      }
   }
   trymove2 = true;
}
static void PM_CheckPosition ( void ) { int xl , xh , yl , yh , bx , by ; tmflags = tmthing -> flags ; tmbbox [ BOXTOP ] = tmy + tmthing -> radius ; tmbbox [ BOXBOTTOM ] = tmy - tmthing -> radius ; tmbbox [ BOXRIGHT ] = tmx + tmthing -> radius ; tmbbox [ BOXLEFT ] = tmx - tmthing -> radius ; newsubsec = R_PointInSubsector ( tmx , tmy ) ; tmfloorz = tmdropoffz = newsubsec -> sector -> floorheight ; tmceilingz = newsubsec -> sector -> ceilingheight ; ++ validcount ; movething = NULL ; blockline = NULL ; if ( tmflags & MF_NOCLIP ) { trymove2 = true ; return ; } xl = ( tmbbox [ BOXLEFT ] - bmaporgx - MAXRADIUS ) >> MAPBLOCKSHIFT ; xh = ( tmbbox [ BOXRIGHT ] - bmaporgx + MAXRADIUS ) >> MAPBLOCKSHIFT ; yl = ( tmbbox [ BOXBOTTOM ] - bmaporgy - MAXRADIUS ) >> MAPBLOCKSHIFT ; yh = ( tmbbox [ BOXTOP ] - bmaporgy + MAXRADIUS ) >> MAPBLOCKSHIFT ; if ( xl < 0 ) xl = 0 ; if ( yl < 0 ) yl = 0 ; if ( xh >= bmapwidth ) xh = bmapwidth - 1 ; if ( yh >= bmapheight ) yh = bmapheight - 1 ; for ( bx = xl ; bx <= xh ; bx ++ ) { for ( by = yl ; by <= yh ; by ++ ) { if ( ! P_BlockThingsIterator ( bx , by , PIT_CheckThing ) ) { trymove2 = false ; return ; } } } xl = ( tmbbox [ BOXLEFT ] - bmaporgx ) >> MAPBLOCKSHIFT ; xh = ( tmbbox [ BOXRIGHT ] - bmaporgx ) >> MAPBLOCKSHIFT ; yl = ( tmbbox [ BOXBOTTOM ] - bmaporgy ) >> MAPBLOCKSHIFT ; yh = ( tmbbox [ BOXTOP ] - bmaporgy ) >> MAPBLOCKSHIFT ; if ( xl < 0 ) xl = 0 ; if ( yl < 0 ) yl = 0 ; if ( xh >= bmapwidth ) xh = bmapwidth - 1 ; if ( yh >= bmapheight ) yh = bmapheight - 1 ; for ( bx = xl ; bx <= xh ; bx ++ ) { for ( by = yl ; by <= yh ; by ++ ) { if ( ! P_BlockLinesIterator ( bx , by , PM_CrossCheck ) ) { trymove2 = false ; return ; } } } trymove2 = true ; }
This is purely informative, nothing is modified (except things picked up)
This is purely informative nothing is modified ( except things picked up )
// the base floor/ceiling is from the subsector that contains the point. // Any contacted lines the step closer together will adjust them. // thing has no clipping? // Check things first, possibly picking things up. // The bounding box is extended by MAXRADIUS because mobj_ts are grouped // into mapblocks based on their origin point, and can overlap into adjacent // blocks by up to MAXRADIUS units. // check things // check lines