mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-17 11:06:30 +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;
|
||||
}
|
||||
|
||||
// If we didn't find a prefix, just start from the first character again.
|
||||
if (!message[i])
|
||||
i = 0;
|
||||
|
||||
// Okay, now make the first non-whitespace character after the prefix a capital.
|
||||
// Okay, now make the first non-whitespace character after this a capital.
|
||||
// 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++)
|
||||
{
|
||||
if ((message[i] & 0x80) || isspace(message[i]))
|
||||
|
|
@ -2708,6 +2705,16 @@ char *M_BuildConditionSetString(UINT16 unlockid)
|
|||
message[i] = toupper(message[i]);
|
||||
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!
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue