mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
M_BuildConditionString: Fix invalid conjunction behaviour
- Nothing except DescriptionOverride will prevent an `- OR ` being inserted - Question marks for further secret types won't prevent alternate conditions from showing up
This commit is contained in:
parent
39d701359a
commit
6df31e96f0
1 changed files with 15 additions and 6 deletions
21
src/m_cond.c
21
src/m_cond.c
|
|
@ -2979,7 +2979,7 @@ char *M_BuildConditionSetString(UINT16 unlockid)
|
|||
static char message[1024] = "";
|
||||
const char *work = NULL;
|
||||
size_t i;
|
||||
boolean stopasap = false;
|
||||
UINT8 stopasap = 0;
|
||||
|
||||
message[0] = '\0';
|
||||
|
||||
|
|
@ -3006,14 +3006,16 @@ char *M_BuildConditionSetString(UINT16 unlockid)
|
|||
{
|
||||
cn = &c->condition[i];
|
||||
|
||||
if (i > 0 && (cn->type != UC_COMMA))
|
||||
if (i > 0)
|
||||
{
|
||||
worklen = 0;
|
||||
if (lastID != cn->id)
|
||||
{
|
||||
stopasap = 0;
|
||||
worklen = 6;
|
||||
strncat(message, " - OR ", len);
|
||||
}
|
||||
else
|
||||
else if (stopasap == 0 && cn->type != UC_COMMA)
|
||||
{
|
||||
worklen = 1;
|
||||
strncat(message, " ", len);
|
||||
|
|
@ -3023,10 +3025,16 @@ char *M_BuildConditionSetString(UINT16 unlockid)
|
|||
|
||||
lastID = cn->id;
|
||||
|
||||
if (stopasap == 1)
|
||||
{
|
||||
// Secret challenge -- show unrelated condition IDs
|
||||
continue;
|
||||
}
|
||||
|
||||
work = M_GetConditionString(cn);
|
||||
if (work == NULL)
|
||||
{
|
||||
stopasap = true;
|
||||
stopasap = 1;
|
||||
if (message[0] && message[1])
|
||||
work = "???";
|
||||
else
|
||||
|
|
@ -3034,15 +3042,16 @@ char *M_BuildConditionSetString(UINT16 unlockid)
|
|||
}
|
||||
else if (cn->type == UC_DESCRIPTIONOVERRIDE)
|
||||
{
|
||||
stopasap = true;
|
||||
stopasap = 2;
|
||||
}
|
||||
worklen = strlen(work);
|
||||
|
||||
strncat(message, work, len);
|
||||
len -= worklen;
|
||||
|
||||
if (stopasap)
|
||||
if (stopasap == 2)
|
||||
{
|
||||
// Description override - hide all further ones
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue