components/prboom/p_map.c
//
// PIT_CheckLine
// Adjusts tmfloorz and tmceilingz as lines are contacted
//
PIT_CheckLine
Adjusts tmfloorz and tmceilingz as lines are contacted
PIT_CheckLine Adjusts tmfloorz and tmceilingz as lines are contacted
static 
boolean PIT_CheckLine (line_t* ld)
{
  if (tmbbox[BOXRIGHT] <= ld->bbox[BOXLEFT]
   || tmbbox[BOXLEFT] >= ld->bbox[BOXRIGHT]
   || tmbbox[BOXTOP] <= ld->bbox[BOXBOTTOM]
   || tmbbox[BOXBOTTOM] >= ld->bbox[BOXTOP] )
    return true; 
  if (P_BoxOnLineSide(tmbbox, ld) != -1)
    return true; 
  if (!ld->backsector) 
    {
      blockline = ld;
      return tmunstuck && !untouched(ld) &&
  FixedMul(tmx-tmthing->x,ld->dy) > FixedMul(tmy-tmthing->y,ld->dx);
    }
  if (!(tmthing->flags & (MF_MISSILE | MF_BOUNCES)))
    {
      if (ld->flags & ML_BLOCKING)           
  return tmunstuck && !untouched(ld);  
      if (!(tmthing->flags & MF_FRIEND || tmthing->player)
    && ld->flags & ML_BLOCKMONSTERS)
  return false; 
    }
  P_LineOpening (ld);
  if (opentop < tmceilingz)
    {
      tmceilingz = opentop;
      ceilingline = ld;
      blockline = ld;
    }
  if (openbottom > tmfloorz)
    {
      tmfloorz = openbottom;
      floorline = ld;          
      blockline = ld;
    }
  if (lowfloor < tmdropoffz)
    tmdropoffz = lowfloor;
  if (ld->special)
    {
      if (numspechit >= spechit_max) {
        spechit_max = spechit_max ? spechit_max*2 : 8;
	spechit = realloc(spechit,sizeof *spechit*spechit_max); 
      }
      spechit[numspechit++] = ld;
      if (numspechit >= 8 && demo_compatibility)
        SpechitOverrun(ld);
    }
  return true;
}
static boolean PIT_CheckLine ( line_t * ld ) { if ( tmbbox [ BOXRIGHT ] <= ld -> bbox [ BOXLEFT ] || tmbbox [ BOXLEFT ] >= ld -> bbox [ BOXRIGHT ] || tmbbox [ BOXTOP ] <= ld -> bbox [ BOXBOTTOM ] || tmbbox [ BOXBOTTOM ] >= ld -> bbox [ BOXTOP ] ) return true ; if ( P_BoxOnLineSide ( tmbbox , ld ) != -1 ) return true ; if ( ! ld -> backsector ) { blockline = ld ; return tmunstuck && ! untouched ( ld ) && FixedMul ( tmx - tmthing -> x , ld -> dy ) > FixedMul ( tmy - tmthing -> y , ld -> dx ) ; } if ( ! ( tmthing -> flags & ( MF_MISSILE | MF_BOUNCES ) ) ) { if ( ld -> flags & ML_BLOCKING ) return tmunstuck && ! untouched ( ld ) ; if ( ! ( tmthing -> flags & MF_FRIEND || tmthing -> player ) && ld -> flags & ML_BLOCKMONSTERS ) return false ; } P_LineOpening ( ld ) ; if ( opentop < tmceilingz ) { tmceilingz = opentop ; ceilingline = ld ; blockline = ld ; } if ( openbottom > tmfloorz ) { tmfloorz = openbottom ; floorline = ld ; blockline = ld ; } if ( lowfloor < tmdropoffz ) tmdropoffz = lowfloor ; if ( ld -> special ) { if ( numspechit >= spechit_max ) { spechit_max = spechit_max ? spechit_max * 2 : 8 ; spechit = realloc ( spechit , sizeof * spechit * spechit_max ) ; } spechit [ numspechit ++ ] = ld ; if ( numspechit >= 8 && demo_compatibility ) SpechitOverrun ( ld ) ; } return true ; }
PIT_CheckLine
Adjusts tmfloorz and tmceilingz as lines are contacted
PIT_CheckLine Adjusts tmfloorz and tmceilingz as lines are contacted
// killough 3/26/98: make static // didn't hit it // didn't hit it // A line has been hit // The moving thing's destination position will cross the given line. // If this should not be allowed, return false. // If the line is special, keep track of it // to process later if the move is proven ok. // NOTE: specials are NOT sorted by order, // so two special lines that are only 8 pixels apart // could be crossed in either order. // killough 7/24/98: allow player to move out of 1s wall, to prevent sticking // one sided line // killough 8/10/98: allow bouncing objects to pass through as missiles // explicitly blocking everything // killough 8/1/98: allow escape // killough 8/9/98: monster-blockers don't affect friends // block monsters only // set openrange, opentop, openbottom // these define a 'window' from one sector to another across this line // adjust floor & ceiling heights // killough 8/1/98: remember floor linedef // if contacted a special line, add it to the list // 1/11/98 killough: remove limit on lines hit, by array doubling // killough // e6y: Spechits overrun emulation code