mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Obj_AudienceInit: Improve follower name processing
- Convert underscores to spaces for string comparison - Report typoes to the user
This commit is contained in:
parent
c7cc730c35
commit
3dd44961a0
1 changed files with 11 additions and 1 deletions
|
|
@ -43,11 +43,21 @@ Obj_AudienceInit
|
|||
// From mapthing
|
||||
char *stringcopy = Z_StrDup(mthing->stringargs[0]);
|
||||
char *tok = strtok(stringcopy, " ,");
|
||||
char *c; // for erasing underscores
|
||||
|
||||
numref = 0;
|
||||
while (tok && numref < MAXHEADERFOLLOWERS)
|
||||
{
|
||||
tempreflist[numref++] = K_FollowerAvailable(tok);
|
||||
// Match follower name conversion
|
||||
for (c = tok; *c; c++)
|
||||
{
|
||||
if (*c != '_')
|
||||
continue;
|
||||
*c = ' ';
|
||||
}
|
||||
|
||||
if ((tempreflist[numref++] = K_FollowerAvailable(tok)) == -1)
|
||||
CONS_Alert(CONS_WARNING, "Mapthing %s: Follower \"%s\" is invalid!\n", sizeu1(mthing-mapthings), tok);
|
||||
tok = strtok(NULL, " ,");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue