From 9383551cc331a9b6a8d65d66a261c5dd369d4d48 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 10 Apr 2024 17:20:45 +0100 Subject: [PATCH 1/2] Remove quotation marks from UC_UNLOCKABLE condition text --- src/m_cond.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_cond.c b/src/m_cond.c index 000e553a3..226443e38 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -2417,7 +2417,7 @@ static const char *M_GetConditionString(condition_t *cn) return work; } case UC_UNLOCKABLE: // Requires unlockable x to be obtained - return va("get \"%s\"", + return va("get %s", gamedata->unlocked[cn->requirement-1] ? unlockables[cn->requirement-1].name : "???"); From 0c782767bec8e6d17b515bf305f1fcb1503613c1 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 10 Apr 2024 17:24:45 +0100 Subject: [PATCH 2/2] Add "then" condition string builder type Better for some sentences --- src/d_netcmd.c | 2 +- src/deh_soc.c | 1 + src/m_cond.c | 5 ++++- src/m_cond.h | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 65d1f2d3d..18239fccf 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -4876,7 +4876,7 @@ static void Command_cxdiag_f(void) continue; } - if (cn->type == UC_AND || cn->type == UC_COMMA) + if (cn->type == UC_AND || cn->type == UC_THEN || cn->type == UC_COMMA) { if (firstpass) ; diff --git a/src/deh_soc.c b/src/deh_soc.c index 3948d3a27..e508c8d49 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -2983,6 +2983,7 @@ static void readcondition(UINT16 set, UINT32 id, char *word2) } } else if ((offset=0) || fastcmp(params[0], "AND") + || (++offset && fastcmp(params[0], "THEN")) || (++offset && fastcmp(params[0], "COMMA"))) { //PARAMCHECK(1); diff --git a/src/m_cond.c b/src/m_cond.c index 226443e38..f4d5422a6 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -1638,6 +1638,7 @@ boolean M_CheckCondition(condition_t *cn, player_t *player) // Just for string building case UC_AND: + case UC_THEN: case UC_COMMA: case UC_DESCRIPTIONOVERRIDE: return true; @@ -2008,7 +2009,7 @@ static boolean M_CheckConditionSet(conditionset_t *c, player_t *player) continue; // Skip entries that are JUST for string building - if (cn->type == UC_AND || cn->type == UC_COMMA || cn->type == UC_DESCRIPTIONOVERRIDE) + if (cn->type == UC_AND || cn->type == UC_THEN || cn->type == UC_COMMA || cn->type == UC_DESCRIPTIONOVERRIDE) continue; lastID = cn->id; @@ -2524,6 +2525,8 @@ static const char *M_GetConditionString(condition_t *cn) case UC_AND: return "&"; + case UC_THEN: + return "then"; case UC_COMMA: return ","; case UC_DESCRIPTIONOVERRIDE: diff --git a/src/m_cond.h b/src/m_cond.h index 90c219c39..b23d267f1 100644 --- a/src/m_cond.h +++ b/src/m_cond.h @@ -76,6 +76,7 @@ typedef enum // Just for string building UC_AND, + UC_THEN, UC_COMMA, UC_DESCRIPTIONOVERRIDE,