From 436c763a02f12f45e8819a6a3d7f08fd1303b585 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Mon, 10 Oct 2022 07:22:42 -0400 Subject: [PATCH] Make MT_WAYPOINT fully use args All of its special flags are contained on args[2] now. --- src/p_mobj.c | 8 ++++---- src/p_setup.c | 23 ++++++++++++++++++++++- src/p_spec.h | 8 ++++++++ 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 078b93fdb..011ba8eec 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -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 diff --git a/src/p_setup.c b/src/p_setup.c index 3e25096fa..1c2099357 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -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 diff --git a/src/p_spec.h b/src/p_spec.h index 33ecd0b4e..1d9496690 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -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,