From 3774e50f21479d849e07eb7ac621ec8229f84936 Mon Sep 17 00:00:00 2001 From: Brad Harding Date: Sat, 30 Nov 2024 11:47:12 +1100 Subject: [PATCH] Minor tweaks --- src/c_cmds.c | 6 +++--- src/p_mobj.c | 10 ++++++---- src/r_patch.c | 21 +++++++++++++-------- src/st_stuff.c | 6 +++--- 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/c_cmds.c b/src/c_cmds.c index 3d4882941..272ae15bb 100644 --- a/src/c_cmds.c +++ b/src/c_cmds.c @@ -4617,6 +4617,9 @@ static void map_func2(char *cmd, char *parms) C_Output(buffer); HU_SetPlayerMessage(buffer, false, false); + if (legacyofrust) + mapcmdepisode = 1; + if (P_IsSecret(mapcmdepisode, mapcmdmap)) message_secret = true; else if (gamemode == commercial) @@ -4629,9 +4632,6 @@ static void map_func2(char *cmd, char *parms) else if (mapcmdmap == 9) message_secret = true; - if (legacyofrust) - mapcmdepisode = 1; - gameepisode = mapcmdepisode; if (gamemission == doom) diff --git a/src/p_mobj.c b/src/p_mobj.c index 63b52511d..8e7630b2b 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1236,11 +1236,13 @@ mobj_t *P_SpawnMapThing(mapthing_t *mthing, const bool spawnmonsters) if (type < 0 || (i = P_FindDoomedNum(type)) == nummobjtypes) { // [BH] make unknown thing type non-fatal and show console warning instead - char *temp = commify(thingid); + char *temp1 = commify(thingid); + char *temp2 = commify(type); - C_Warning(2, "Thing %s at (%i, %i) wasn't spawned because its type is unknown.", - temp, mthing->x, mthing->y); - free(temp); + C_Warning(2, "Thing %s at (%i, %i) wasn't spawned because it has an unknown type of %s.", + temp1, mthing->x, mthing->y, temp2); + free(temp1); + free(temp2); return NULL; } diff --git a/src/r_patch.c b/src/r_patch.c index ee62ec58e..cc7320f40 100644 --- a/src/r_patch.c +++ b/src/r_patch.c @@ -58,14 +58,19 @@ static short STEP2; static bool IsSolidAtSpot(const column_t *column, const int spot) { - if (column) - while (column->topdelta != 0xFF) - if (spot < column->topdelta) - return false; - else if (spot <= column->topdelta + column->length) - return true; - else - column = (const column_t *)((const byte *)column + 3 + column->length + 1); + if (!column) + return false; + + while (column->topdelta != 0xFF) + { + if (spot < column->topdelta) + return false; + + if (spot <= column->topdelta + column->length) + return true; + + column = (const column_t *)((const byte *)column + 3 + column->length + 1); + } return false; } diff --git a/src/st_stuff.c b/src/st_stuff.c index 1dee5ecec..ee5615a46 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1036,6 +1036,9 @@ bool ST_Responder(const event_t *ev) C_Output(message); HU_SetPlayerMessage(message, false, false); + if (legacyofrust) + epsd = 1; + if (P_IsSecret(epsd, map)) message_secret = true; else if (gamemode == commercial) @@ -1049,9 +1052,6 @@ bool ST_Responder(const event_t *ev) message_secret = true; } - if (legacyofrust) - epsd = 1; - // [BH] always display message message_dontfuckwithme = true;