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)
|
void loadFighters(cJSON *node)
|
||||||
{
|
{
|
||||||
Entity *e;
|
Entity *e;
|
||||||
char **types, *name, *groupName, *type;
|
char **types, *name, *groupName, *type, *strpos;
|
||||||
int side, scatter, number, active;
|
int side, scatter, number, active;
|
||||||
int i, numTypes, addFlags, addAIFlags;
|
int i, numTypes, addFlags, addAIFlags, id;
|
||||||
long flags, aiFlags;
|
long flags, aiFlags;
|
||||||
float x, y;
|
float x, y;
|
||||||
|
|
||||||
if (node)
|
if (node)
|
||||||
{
|
{
|
||||||
|
id = 0;
|
||||||
|
|
||||||
node = node->child;
|
node = node->child;
|
||||||
|
|
||||||
while (node)
|
while (node)
|
||||||
|
@ -869,6 +871,14 @@ void loadFighters(cJSON *node)
|
||||||
if (name)
|
if (name)
|
||||||
{
|
{
|
||||||
STRNCPY(e->name, name, MAX_NAME_LENGTH);
|
STRNCPY(e->name, name, MAX_NAME_LENGTH);
|
||||||
|
|
||||||
|
/* update 'name #?' to 'name #1', etc. */
|
||||||
|
strpos = strstr(e->name, "#?");
|
||||||
|
|
||||||
|
if (strpos)
|
||||||
|
{
|
||||||
|
*(++strpos) = ('0' + ++id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (groupName)
|
if (groupName)
|
||||||
|
|
Loading…
Reference in New Issue