components/prboom/p_map.c
//
// P_ThingHeightClip
// Takes a valid thing and adjusts the thing->floorz,
// thing->ceilingz, and possibly thing->z.
// This is called for all nearby monsters
// whenever a sector changes height.
// If the thing doesn't fit,
// the z will be set to the lowest value
// and false will be returned.
//
P_ThingHeightClip
Takes a valid thing and adjusts the thing->floorz,
thing->ceilingz, and possibly thing->z.
This is called for all nearby monsters
whenever a sector changes height.
If the thing doesn't fit,
the z will be set to the lowest value
and false will be returned.
P_ThingHeightClip Takes a valid thing and adjusts the thing - > floorz thing - > ceilingz and possibly thing - > z . This is called for all nearby monsters whenever a sector changes height . If the thing doesn ' t fit the z will be set to the lowest value and false will be returned .
boolean P_ThingHeightClip (mobj_t* thing)
{
  boolean   onfloor;
  onfloor = (thing->z == thing->floorz);
  P_CheckPosition (thing, thing->x, thing->y);
  thing->floorz = tmfloorz;
  thing->ceilingz = tmceilingz;
  thing->dropoffz = tmdropoffz;    
  if (onfloor)
    {
    thing->z = thing->floorz;
      if (thing->intflags & MIF_FALLING && thing->gear >= MAXGEAR)
  thing->gear = 0;
    }
  else
    {
    if (thing->z+thing->height > thing->ceilingz)
      thing->z = thing->ceilingz - thing->height;
    }
  return thing->ceilingz - thing->floorz >= thing->height;
}
boolean P_ThingHeightClip ( mobj_t * thing ) { boolean onfloor ; onfloor = ( thing -> z == thing -> floorz ) ; P_CheckPosition ( thing , thing -> x , thing -> y ) ; thing -> floorz = tmfloorz ; thing -> ceilingz = tmceilingz ; thing -> dropoffz = tmdropoffz ; if ( onfloor ) { thing -> z = thing -> floorz ; if ( thing -> intflags & MIF_FALLING && thing -> gear >= MAXGEAR ) thing -> gear = 0 ; } else { if ( thing -> z + thing -> height > thing -> ceilingz ) thing -> z = thing -> ceilingz - thing -> height ; } return thing -> ceilingz - thing -> floorz >= thing -> height ; }
P_ThingHeightClip
Takes a valid thing and adjusts the thing->floorz,
thing->ceilingz, and possibly thing->z.
P_ThingHeightClip Takes a valid thing and adjusts the thing - > floorz thing - > ceilingz and possibly thing - > z .
/* what about stranding a monster partially off an edge?
   * killough 11/98: Answer: see below (upset balance if hanging off ledge)
   */ /* killough 11/98: remember dropoffs */ // walking monsters rise and fall with the floor /* killough 11/98: Possibly upset balance of objects hanging off ledges */ // don't adjust a floating monster unless forced to