Make MT_WAYPOINT fully use args

All of its special flags are contained on args[2] now.
This commit is contained in:
Sally Coolatta 2022-10-10 07:22:42 -04:00
parent 032ffafd39
commit 436c763a02
3 changed files with 34 additions and 5 deletions

View file

@ -12565,7 +12565,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
// extravalue2 is used for indicating the waypoint is the finishline
mobj->threshold = mthing->args[0];
mobj->movecount = tag;
if (mthing->options & MTF_EXTRA)
if (mthing->args[2] & TMWPF_DISABLED)
{
mobj->extravalue1 = 0; // The waypoint is disabled if extra is on
}
@ -12573,7 +12573,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
{
mobj->extravalue1 = 1;
}
if (mthing->options & MTF_OBJECTSPECIAL)
if (mthing->args[2] & TMWPF_SHORTCUT)
{
mobj->lastlook = 1; // the waypoint is a shortcut if objectspecial is on
}
@ -12581,7 +12581,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
{
mobj->lastlook = 0;
}
if (mthing->options & MTF_AMBUSH)
if (mthing->args[2] & TMWPF_NORESPAWN)
{
mobj->reactiontime = 0; // Can't respawn at if Ambush is on
}
@ -12589,7 +12589,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
{
mobj->reactiontime = 1;
}
if (mthing->args[2] == 1)
if (mthing->args[2] & TMWPF_FINISHLINE)
{
mobj->extravalue2 = 1; // args[2] of 1 means the waypoint is at the finish line
mobj->reactiontime = 0; // Also don't respawn at finish lines

View file

@ -6456,8 +6456,8 @@ static void P_ConvertBinaryThingTypes(void)
INT32 firstline = Tag_FindLineSpecial(2000, (INT16)mapthings[i].angle);
Tag_FSet(&mapthings[i].tags, mapthings[i].angle);
mapthings[i].args[0] = mapthings[i].z;
mapthings[i].args[2] = mapthings[i].extrainfo;
mapthings[i].z = 0;
if (firstline != -1)
@ -6470,6 +6470,27 @@ static void P_ConvertBinaryThingTypes(void)
mapthings[i].z = linez / FRACUNIT;
}
if (mapthings[i].extrainfo == 1)
{
mapthings[i].args[2] |= TMWPF_FINISHLINE;
}
if (mapthings[i].options & MTF_EXTRA)
{
mapthings[i].args[2] |= TMWPF_DISABLED;
}
if (mapthings[i].options & MTF_OBJECTSPECIAL)
{
mapthings[i].args[2] |= TMWPF_SHORTCUT;
}
if (mapthings[i].options & MTF_AMBUSH)
{
mapthings[i].args[2] |= TMWPF_NORESPAWN;
}
break;
}
case 2004: // MT_BOTHINT

View file

@ -49,6 +49,14 @@ typedef enum
TMSF_INTANGIBLE = 1<<1,
} textmapspikeflags_t;
typedef enum
{
TMWPF_DISABLED = 1,
TMWPF_SHORTCUT = 1<<1,
TMWPF_NORESPAWN = 1<<2,
TMWPF_FINISHLINE = 1<<3,
} textmapwaypointflags_t;
typedef enum
{
TMFF_AIMLESS = 1,