mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 20:41:46 +00:00
Self-review: Guarantee the first character of the Challenge Hint is also uppercase, thanks to a possible prefix being "The Controls Tutorial:"
This commit is contained in:
parent
94cfda6832
commit
d1ad45236f
1 changed files with 12 additions and 5 deletions
17
src/m_cond.c
17
src/m_cond.c
|
|
@ -2695,12 +2695,9 @@ char *M_BuildConditionSetString(UINT16 unlockid)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we didn't find a prefix, just start from the first character again.
|
// Okay, now make the first non-whitespace character after this a capital.
|
||||||
if (!message[i])
|
|
||||||
i = 0;
|
|
||||||
|
|
||||||
// Okay, now make the first non-whitespace character after the prefix a capital.
|
|
||||||
// Doesn't matter if !isalpha() - toupper is a no-op.
|
// Doesn't matter if !isalpha() - toupper is a no-op.
|
||||||
|
// (If the first loop hit the string's end, the message[i] check keeps us safe)
|
||||||
for (; message[i]; i++)
|
for (; message[i]; i++)
|
||||||
{
|
{
|
||||||
if ((message[i] & 0x80) || isspace(message[i]))
|
if ((message[i] & 0x80) || isspace(message[i]))
|
||||||
|
|
@ -2708,6 +2705,16 @@ char *M_BuildConditionSetString(UINT16 unlockid)
|
||||||
message[i] = toupper(message[i]);
|
message[i] = toupper(message[i]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Also do this for the prefix.
|
||||||
|
// This might seem redundant, but "the Controls Tutorial:" is a possible prefix!
|
||||||
|
for (i = 0; message[i]; i++)
|
||||||
|
{
|
||||||
|
if ((message[i] & 0x80) || isspace(message[i]))
|
||||||
|
continue;
|
||||||
|
message[i] = toupper(message[i]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finally, do a clean wordwrap!
|
// Finally, do a clean wordwrap!
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue