From aa80132976397f500a482e32bcf89b59f9d7bb4b Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 4 May 2020 17:33:43 -0700 Subject: [PATCH 1/3] Let Waypoint Anchors apply to multiple waypoints with the same ID --- src/k_waypoint.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/k_waypoint.c b/src/k_waypoint.c index f32cf68b0..d320d4a19 100644 --- a/src/k_waypoint.c +++ b/src/k_waypoint.c @@ -1937,8 +1937,7 @@ void K_AdjustWaypointsParameters (void) waypointmobj; waypointmobj = waypointmobj->tracer ){ - if (K_AnchorWaypointRadius(waypointmobj, anchor)) - break; + K_AnchorWaypointRadius(waypointmobj, anchor); } } } From e2d4ddcec2dddad5b103c272e7db8b6832f3e287 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 4 May 2020 17:39:11 -0700 Subject: [PATCH 2/3] SOC: DefaultWaypointRadius in the level header picardy --- src/dehacked.c | 2 ++ src/doomstat.h | 1 + src/k_waypoint.h | 2 ++ src/p_mobj.c | 2 +- src/p_setup.c | 2 ++ 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/dehacked.c b/src/dehacked.c index db94c5227..37a8d1766 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1305,6 +1305,8 @@ static void readlevelheader(MYFILE *f, INT32 num) }*/ else if (fastcmp(word, "MOBJSCALE")) mapheaderinfo[num-1]->mobj_scale = get_number(word2); + else if (fastcmp(word, "DEFAULTWAYPOINTRADIUS")) + mapheaderinfo[num-1]->default_waypoint_radius = get_number(word2); // Individual triggers for level flags, for ease of use (and 2.0 compatibility) else if (fastcmp(word, "SCRIPTISFILE")) diff --git a/src/doomstat.h b/src/doomstat.h index 9464385ea..fcb99b507 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -290,6 +290,7 @@ typedef struct // SRB2kart //boolean automap; ///< Displays a level's white map outline in modified games fixed_t mobj_scale; ///< Replacement for TOL_ERZ3 + fixed_t default_waypoint_radius; // Music stuff. UINT32 musinterfadeout; ///< Fade out level music on intermission screen in milliseconds diff --git a/src/k_waypoint.h b/src/k_waypoint.h index 0017c443e..b34527b6f 100644 --- a/src/k_waypoint.h +++ b/src/k_waypoint.h @@ -18,6 +18,8 @@ #include "p_mobj.h" #include "k_pathfind.h" +#define DEFAULT_WAYPOINT_RADIUS (384*FRACUNIT) + typedef struct waypoint_s { mobj_t *mobj; diff --git a/src/p_mobj.c b/src/p_mobj.c index 1a7c562a7..57ef4a426 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -12667,7 +12667,7 @@ ML_NOCLIMB : Direction not controllable { // Just like MT_SPINMACEPOINT, this now works here too! INT32 line = P_FindSpecialLineFromTag(2000, mthing->angle, -1); - mobj->radius = 384*FRACUNIT; + mobj->radius = mapheaderinfo[gamemap-1]->default_waypoint_radius; // Set the radius, mobj z, and mthing z to match what the parameters want if (line != -1) { diff --git a/src/p_setup.c b/src/p_setup.c index 0708379ed..459160bd6 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -258,6 +258,8 @@ static void P_ClearSingleMapHeaderInfo(INT16 i) //mapheaderinfo[num]->automap = false; DEH_WriteUndoline("MOBJSCALE", va("%d", mapheaderinfo[num]->mobj_scale), UNDO_NONE); mapheaderinfo[num]->mobj_scale = FRACUNIT; + DEH_WriteUndoline("DEFAULTWAYPOINTRADIUS", va("%d", mapheaderinfo[num]->default_waypoint_radius), UNDO_NONE); + mapheaderinfo[num]->default_waypoint_radius = DEFAULT_WAYPOINT_RADIUS; // an even further impossibility, delfile custom opts support mapheaderinfo[num]->customopts = NULL; mapheaderinfo[num]->numCustomOptions = 0; From 7c9824dc5645372539d66bbf1794762e4a2e83a8 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 4 May 2020 17:54:43 -0700 Subject: [PATCH 3/3] Multiply the default radius of 384 by mobjscale, but not user set radiuses --- src/doomstat.h | 2 +- src/k_waypoint.h | 2 +- src/p_mobj.c | 10 +++++++++- src/p_setup.c | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/doomstat.h b/src/doomstat.h index fcb99b507..3043df8e1 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -290,7 +290,7 @@ typedef struct // SRB2kart //boolean automap; ///< Displays a level's white map outline in modified games fixed_t mobj_scale; ///< Replacement for TOL_ERZ3 - fixed_t default_waypoint_radius; + fixed_t default_waypoint_radius; ///< 0 is a special value for DEFAULT_WAYPOINT_RADIUS, but scaled with mobjscale // Music stuff. UINT32 musinterfadeout; ///< Fade out level music on intermission screen in milliseconds diff --git a/src/k_waypoint.h b/src/k_waypoint.h index b34527b6f..41230b49b 100644 --- a/src/k_waypoint.h +++ b/src/k_waypoint.h @@ -18,7 +18,7 @@ #include "p_mobj.h" #include "k_pathfind.h" -#define DEFAULT_WAYPOINT_RADIUS (384*FRACUNIT) +#define DEFAULT_WAYPOINT_RADIUS (384) typedef struct waypoint_s { diff --git a/src/p_mobj.c b/src/p_mobj.c index 57ef4a426..a628c8325 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -12665,9 +12665,17 @@ ML_NOCLIMB : Direction not controllable break; case MT_WAYPOINT: { + const fixed_t mobjscale = + mapheaderinfo[gamemap-1]->default_waypoint_radius; + // Just like MT_SPINMACEPOINT, this now works here too! INT32 line = P_FindSpecialLineFromTag(2000, mthing->angle, -1); - mobj->radius = mapheaderinfo[gamemap-1]->default_waypoint_radius; + + if (mobjscale == 0) + mobj->radius = DEFAULT_WAYPOINT_RADIUS * mapobjectscale; + else + mobj->radius = mobjscale; + // Set the radius, mobj z, and mthing z to match what the parameters want if (line != -1) { diff --git a/src/p_setup.c b/src/p_setup.c index 459160bd6..ddd11eac4 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -259,7 +259,7 @@ static void P_ClearSingleMapHeaderInfo(INT16 i) DEH_WriteUndoline("MOBJSCALE", va("%d", mapheaderinfo[num]->mobj_scale), UNDO_NONE); mapheaderinfo[num]->mobj_scale = FRACUNIT; DEH_WriteUndoline("DEFAULTWAYPOINTRADIUS", va("%d", mapheaderinfo[num]->default_waypoint_radius), UNDO_NONE); - mapheaderinfo[num]->default_waypoint_radius = DEFAULT_WAYPOINT_RADIUS; + mapheaderinfo[num]->default_waypoint_radius = 0; // an even further impossibility, delfile custom opts support mapheaderinfo[num]->customopts = NULL; mapheaderinfo[num]->numCustomOptions = 0;