Change #? in names to #1, etc. when loading. For use with message boxes.
This commit is contained in:
parent
0229a2dae7
commit
06610583fe
|
@ -782,14 +782,16 @@ static void loadFighterDef(char *filename)
|
|||
void loadFighters(cJSON *node)
|
||||
{
|
||||
Entity *e;
|
||||
char **types, *name, *groupName, *type;
|
||||
char **types, *name, *groupName, *type, *strpos;
|
||||
int side, scatter, number, active;
|
||||
int i, numTypes, addFlags, addAIFlags;
|
||||
int i, numTypes, addFlags, addAIFlags, id;
|
||||
long flags, aiFlags;
|
||||
float x, y;
|
||||
|
||||
if (node)
|
||||
{
|
||||
id = 0;
|
||||
|
||||
node = node->child;
|
||||
|
||||
while (node)
|
||||
|
@ -869,6 +871,14 @@ void loadFighters(cJSON *node)
|
|||
if (name)
|
||||
{
|
||||
STRNCPY(e->name, name, MAX_NAME_LENGTH);
|
||||
|
||||
/* update 'name #?' to 'name #1', etc. */
|
||||
strpos = strstr(e->name, "#?");
|
||||
|
||||
if (strpos)
|
||||
{
|
||||
*(++strpos) = ('0' + ++id);
|
||||
}
|
||||
}
|
||||
|
||||
if (groupName)
|
||||
|
|
Loading…
Reference in New Issue