From e4a3b85adfa4e1e290e8372982a8c8dab8410306 Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 14 Oct 2023 22:36:41 +0100 Subject: [PATCH] UC_UNLOCKPERCENT: Make SECRET_COLOR option actually count Spray Cans, not unlockables directly --- src/m_cond.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/m_cond.c b/src/m_cond.c index 1c6530a5b..bcce1c0b5 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -1349,6 +1349,12 @@ boolean M_CheckCondition(condition_t *cn, player_t *player) unlocked++; } } + // Special case for SECRET_COLOR + else if (cn->extrainfo1 == SECRET_COLOR) + { + total = gamedata->numspraycans; + unlocked = gamedata->gotspraycans; + } // Special case for raw Challenge count else if (cn->extrainfo1 == SECRET_NONE) { @@ -2017,8 +2023,8 @@ static const char *M_GetConditionString(condition_t *cn) checkavailable = true; break; case SECRET_COLOR: - work = "of Spray Cans"; - checkavailable = true; + work = (gamedata->gotspraycans == 0) ? "of ???" : "of Spray Cans"; + //checkavailable = true; break; default: return va("INVALID CHALLENGE FOR PERCENT \"%d\"", cn->requirement);