p_move.c
//
// Attempt to move to a new position, crossing special lines unless MF_TELEPORT
// is set.
//
Attempt to move to a new position, crossing special lines unless MF_TELEPORT
is set.
Attempt to move to a new position crossing special lines unless MF_TELEPORT is set .
void P_TryMove2(void)
{
   trymove2 = false;
   floatok  = false;
   oldx = tmthing->x;
   oldy = tmthing->y;
   PM_CheckPosition();
   if(checkposonly)
   {
      checkposonly = false;
      return;
   }
   if(!trymove2)
      return;
   if(!(tmthing->flags & MF_NOCLIP))
   {
      trymove2 = false;
      if(tmceilingz - tmfloorz < tmthing->height)
         return; 
      floatok = true;
      if(!(tmthing->flags & MF_TELEPORT) && tmceilingz - tmthing->z < tmthing->height)
         return; 
      if(!(tmthing->flags & MF_TELEPORT) && tmfloorz - tmthing->z > 24*FRACUNIT)
         return; 
      if(!(tmthing->flags & (MF_DROPOFF|MF_FLOAT)) && tmfloorz - tmdropoffz > 24*FRACUNIT)
         return; 
   }
   P_UnsetThingPosition(tmthing);
   tmthing->floorz   = tmfloorz;
   tmthing->ceilingz = tmceilingz;
   tmthing->x        = tmx;
   tmthing->y        = tmy;
   P_SetThingPosition(tmthing);
   trymove2 = true;
}
void P_TryMove2 ( void ) { trymove2 = false ; floatok = false ; oldx = tmthing -> x ; oldy = tmthing -> y ; PM_CheckPosition ( ) ; if ( checkposonly ) { checkposonly = false ; return ; } if ( ! trymove2 ) return ; if ( ! ( tmthing -> flags & MF_NOCLIP ) ) { trymove2 = false ; if ( tmceilingz - tmfloorz < tmthing -> height ) return ; floatok = true ; if ( ! ( tmthing -> flags & MF_TELEPORT ) && tmceilingz - tmthing -> z < tmthing -> height ) return ; if ( ! ( tmthing -> flags & MF_TELEPORT ) && tmfloorz - tmthing -> z > 24 * FRACUNIT ) return ; if ( ! ( tmthing -> flags & ( MF_DROPOFF | MF_FLOAT ) ) && tmfloorz - tmdropoffz > 24 * FRACUNIT ) return ; } P_UnsetThingPosition ( tmthing ) ; tmthing -> floorz = tmfloorz ; tmthing -> ceilingz = tmceilingz ; tmthing -> x = tmx ; tmthing -> y = tmy ; P_SetThingPosition ( tmthing ) ; trymove2 = true ; }
Attempt to move to a new position, crossing special lines unless MF_TELEPORT
is set.
Attempt to move to a new position crossing special lines unless MF_TELEPORT is set .
// doesn't fit // mobj must lower itself to fit // too big a step up // don't stand over a dropoff // the move is ok, so link the thing into its new position.