mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-19 07:51:43 +00:00
polywaypointdata_t: Turn reverse and continuous into flags
This commit is contained in:
parent
06dda9c69d
commit
536e355cdf
3 changed files with 17 additions and 10 deletions
|
@ -2154,11 +2154,12 @@ boolean EV_DoPolyObjWaypoint(polywaypointdata_t *pwdata)
|
|||
// set fields
|
||||
th->polyObjNum = pwdata->polyObjNum;
|
||||
th->speed = pwdata->speed;
|
||||
th->sequence = pwdata->sequence; // Used to specify sequence #
|
||||
th->direction = pwdata->reverse ? -1 : 1;
|
||||
th->sequence = pwdata->sequence;
|
||||
th->direction = (pwdata->flags & PWF_REVERSE) ? -1 : 1;
|
||||
|
||||
th->returnbehavior = pwdata->returnbehavior;
|
||||
th->continuous = pwdata->continuous;
|
||||
if (pwdata->flags & PWF_LOOP)
|
||||
th->continuous = true;
|
||||
th->stophere = false;
|
||||
|
||||
// Find the first waypoint we need to use
|
||||
|
@ -2172,11 +2173,8 @@ boolean EV_DoPolyObjWaypoint(polywaypointdata_t *pwdata)
|
|||
return false;
|
||||
}
|
||||
|
||||
// Set pointnum
|
||||
th->pointnum = first->health;
|
||||
|
||||
// We don't deal with the mirror crap here, we'll
|
||||
// handle that in the T_Thinker function.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -254,14 +254,19 @@ typedef struct polymovedata_s
|
|||
UINT8 overRide; // if true, will override any action on the object
|
||||
} polymovedata_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PWF_REVERSE = 1, // Move through waypoints in reverse order
|
||||
PWF_LOOP = 1<<1, // Loop movement (used with PWR_WRAP or PWR_COMEBACK)
|
||||
} polywaypointflags_e;
|
||||
|
||||
typedef struct polywaypointdata_s
|
||||
{
|
||||
INT32 polyObjNum; // numeric id of polyobject to affect
|
||||
INT32 sequence; // waypoint sequence #
|
||||
fixed_t speed; // linear speed
|
||||
UINT8 reverse; // if true, will go in reverse waypoint order
|
||||
UINT8 returnbehavior; // behavior after reaching the last waypoint
|
||||
UINT8 continuous; // continuously move - used with PWR_WRAP or PWR_COMEBACK
|
||||
UINT8 flags; // PWF_ flags
|
||||
} polywaypointdata_t;
|
||||
|
||||
// polyobject door types
|
||||
|
|
|
@ -1276,7 +1276,6 @@ static boolean PolyWaypoint(line_t *line)
|
|||
pwd.polyObjNum = line->tag;
|
||||
pwd.speed = sides[line->sidenum[0]].textureoffset / 8;
|
||||
pwd.sequence = sides[line->sidenum[0]].rowoffset >> FRACBITS; // Sequence #
|
||||
pwd.reverse = (line->flags & ML_EFFECT1) == ML_EFFECT1; // Reverse?
|
||||
|
||||
// Behavior after reaching the last waypoint?
|
||||
if (line->flags & ML_EFFECT3)
|
||||
|
@ -1286,7 +1285,12 @@ static boolean PolyWaypoint(line_t *line)
|
|||
else
|
||||
pwd.returnbehavior = PWR_STOP; // Stop
|
||||
|
||||
pwd.continuous = (line->flags & ML_EFFECT4) == ML_EFFECT4; // Continuously move - used with PWR_WRAP or PWR_COMEBACK
|
||||
// Flags
|
||||
pwd.flags = 0;
|
||||
if (line->flags & ML_EFFECT1)
|
||||
pwd.flags |= PWF_REVERSE;
|
||||
if (line->flags & ML_EFFECT4)
|
||||
pwd.flags |= PWF_LOOP;
|
||||
|
||||
return EV_DoPolyObjWaypoint(&pwd);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue