Do some cleanup

This commit is contained in:
James R 2020-04-21 00:21:41 -07:00
parent 62143d32b3
commit 02f30814eb

View file

@ -1773,20 +1773,28 @@ void K_ClearWaypoints(void)
} }
/*-------------------------------------------------- /*--------------------------------------------------
void K_AdjustWaypointsParameters(void) static boolean K_RaiseWaypoint(
mobj_t *const waypointmobj,
const mobj_t *const riser)
See header file for description. Raise a waypoint according a waypoint riser thing.
Input Arguments:-
waypointmobj - The mobj of the waypoint to raise
riser - The waypoint riser mobj
Return:-
True if the waypoint was risen, false if not.
--------------------------------------------------*/ --------------------------------------------------*/
void K_AdjustWaypointsParameters (void) static boolean K_RaiseWaypoint(
mobj_t *const waypointmobj,
const mobj_t *const riser)
{ {
mobj_t *waypointmobj;
mobj_t *riser;
fixed_t x; fixed_t x;
fixed_t y; fixed_t y;
sector_t *sector; const sector_t *sector;
ffloor_t *rover; ffloor_t *rover;
boolean descending; boolean descending;
@ -1794,24 +1802,9 @@ void K_AdjustWaypointsParameters (void)
fixed_t sort; fixed_t sort;
fixed_t z; fixed_t z;
for (
waypointmobj = waypointcap;
waypointmobj;
waypointmobj = waypointmobj->tracer
){
sector = waypointmobj->subsector->sector;
for (
riser = sector->thinglist;
riser;
riser = riser->snext
){
if ( if (
riser->type == MT_WAYPOINT_RISER &&
(
!( riser->spawnpoint->options & MTF_OBJECTSPECIAL ) || !( riser->spawnpoint->options & MTF_OBJECTSPECIAL ) ||
riser->spawnpoint->angle == waypointmobj->spawnpoint->angle riser->spawnpoint->angle == waypointmobj->spawnpoint->angle
)
){ ){
if (( riser->spawnpoint->options & MTF_AMBUSH )) if (( riser->spawnpoint->options & MTF_AMBUSH ))
{ {
@ -1824,6 +1817,8 @@ void K_AdjustWaypointsParameters (void)
descending = ( riser->spawnpoint->options & MTF_OBJECTFLIP ); descending = ( riser->spawnpoint->options & MTF_OBJECTFLIP );
sector = waypointmobj->subsector->sector;
if (descending) if (descending)
sort = sector->ceilingheight; sort = sector->ceilingheight;
else else
@ -1852,6 +1847,42 @@ void K_AdjustWaypointsParameters (void)
waypointmobj->z = sort; waypointmobj->z = sort;
} }
return true;
}
else
return false;
}
/*--------------------------------------------------
void K_AdjustWaypointsParameters(void)
See header file for description.
--------------------------------------------------*/
void K_AdjustWaypointsParameters (void)
{
mobj_t *waypointmobj;
const mobj_t *riser;
const sector_t *sector;
for (
waypointmobj = waypointcap;
waypointmobj;
waypointmobj = waypointmobj->tracer
){
sector = waypointmobj->subsector->sector;
for (
riser = sector->thinglist;
riser;
riser = riser->snext
){
if (riser->type == MT_WAYPOINT_RISER)
{
if (K_RaiseWaypoint(waypointmobj, riser))
break;
} }
} }
} }