Get plural replacement working.
This commit is contained in:
parent
5de9c7132d
commit
f715091db6
1 changed files with 20 additions and 0 deletions
20
misc.c
20
misc.c
|
@ -68,6 +68,26 @@ void newspeak(char* msg)
|
|||
copy[i + 1] = 's';
|
||||
sprintf(parameters[param_index], "%d", PARMS[param_index]);
|
||||
}
|
||||
|
||||
// Plain string specifier.
|
||||
if (msg[i + 1] == 's')
|
||||
{
|
||||
packed_to_token(PARMS[param_index], parameters[param_index]);
|
||||
}
|
||||
|
||||
// Plural replacement specifier.
|
||||
if (msg[i + 1] == 'S')
|
||||
{
|
||||
copy[i + 1] = 's';
|
||||
if (PARMS[param_index - 1] > 1)
|
||||
{
|
||||
sprintf(parameters[param_index], "%s", "s");
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(parameters[param_index], "%s", "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue