Added id to objective, to allow script to function in non-English languages.
This commit is contained in:
parent
30fa446006
commit
4ef796bf92
|
@ -205,7 +205,7 @@ void activateObjectives(char *objectives)
|
||||||
{
|
{
|
||||||
for (o = battle.objectiveHead.next ; o != NULL ; o = o->next)
|
for (o = battle.objectiveHead.next ; o != NULL ; o = o->next)
|
||||||
{
|
{
|
||||||
if (strcmp(token, o->description) == 0)
|
if (strcmp(token, o->id) == 0)
|
||||||
{
|
{
|
||||||
addHudMessage(colors.cyan, _("New Objective : %s"), o->description);
|
addHudMessage(colors.cyan, _("New Objective : %s"), o->description);
|
||||||
o->active = 1;
|
o->active = 1;
|
||||||
|
|
|
@ -329,6 +329,7 @@ static void loadObjectives(cJSON *node)
|
||||||
battle.objectiveTail->next = o;
|
battle.objectiveTail->next = o;
|
||||||
battle.objectiveTail = o;
|
battle.objectiveTail = o;
|
||||||
|
|
||||||
|
STRNCPY(o->id, cJSON_GetObjectItem(node, "description")->valuestring, MAX_DESCRIPTION_LENGTH);
|
||||||
STRNCPY(o->description, _(cJSON_GetObjectItem(node, "description")->valuestring), MAX_DESCRIPTION_LENGTH);
|
STRNCPY(o->description, _(cJSON_GetObjectItem(node, "description")->valuestring), MAX_DESCRIPTION_LENGTH);
|
||||||
STRNCPY(o->targetName, cJSON_GetObjectItem(node, "targetName")->valuestring, MAX_NAME_LENGTH);
|
STRNCPY(o->targetName, cJSON_GetObjectItem(node, "targetName")->valuestring, MAX_NAME_LENGTH);
|
||||||
o->targetValue = cJSON_GetObjectItem(node, "targetValue")->valueint;
|
o->targetValue = cJSON_GetObjectItem(node, "targetValue")->valueint;
|
||||||
|
@ -793,8 +794,8 @@ static void loadSpawners(cJSON *node)
|
||||||
s->types = toTypeArray(cJSON_GetObjectItem(node, "types")->valuestring, &s->numTypes);
|
s->types = toTypeArray(cJSON_GetObjectItem(node, "types")->valuestring, &s->numTypes);
|
||||||
s->side = lookup(cJSON_GetObjectItem(node, "side")->valuestring);
|
s->side = lookup(cJSON_GetObjectItem(node, "side")->valuestring);
|
||||||
s->interval = cJSON_GetObjectItem(node, "interval")->valueint * FPS;
|
s->interval = cJSON_GetObjectItem(node, "interval")->valueint * FPS;
|
||||||
s->limit = cJSON_GetObjectItem(node, "limit")->valueint;
|
s->limit = getJSONValue(node, "limit", 0);
|
||||||
s->total = cJSON_GetObjectItem(node, "total")->valueint;
|
s->total = getJSONValue(node, "total", 0);
|
||||||
s->step = cJSON_GetObjectItem(node, "step")->valueint;
|
s->step = cJSON_GetObjectItem(node, "step")->valueint;
|
||||||
s->offscreen = getJSONValue(node, "offscreen", 0);
|
s->offscreen = getJSONValue(node, "offscreen", 0);
|
||||||
s->active = active = getJSONValue(node, "active", 1);
|
s->active = active = getJSONValue(node, "active", 1);
|
||||||
|
|
|
@ -226,6 +226,7 @@ struct Location {
|
||||||
|
|
||||||
struct Objective {
|
struct Objective {
|
||||||
int active;
|
int active;
|
||||||
|
char id[MAX_DESCRIPTION_LENGTH];
|
||||||
char description[MAX_DESCRIPTION_LENGTH];
|
char description[MAX_DESCRIPTION_LENGTH];
|
||||||
char targetName[MAX_NAME_LENGTH];
|
char targetName[MAX_NAME_LENGTH];
|
||||||
int targetType;
|
int targetType;
|
||||||
|
|
Loading…
Reference in New Issue