Added defName to entity, to allow printing of definition name of the entity.

This commit is contained in:
Steve 2015-11-01 12:29:32 +00:00
parent 2a38221bcf
commit 018d30132e
2 changed files with 2 additions and 0 deletions

View File

@ -81,6 +81,7 @@ static void loadFighterDef(char *filename)
root = cJSON_Parse(text); root = cJSON_Parse(text);
STRNCPY(f->name, cJSON_GetObjectItem(root, "name")->valuestring, MAX_NAME_LENGTH); STRNCPY(f->name, cJSON_GetObjectItem(root, "name")->valuestring, MAX_NAME_LENGTH);
STRNCPY(f->defName, cJSON_GetObjectItem(root, "name")->valuestring, MAX_NAME_LENGTH);
f->health = f->maxHealth = cJSON_GetObjectItem(root, "health")->valueint; f->health = f->maxHealth = cJSON_GetObjectItem(root, "health")->valueint;
f->shield = f->maxShield = cJSON_GetObjectItem(root, "shield")->valueint; f->shield = f->maxShield = cJSON_GetObjectItem(root, "shield")->valueint;
f->speed = cJSON_GetObjectItem(root, "speed")->valuedouble; f->speed = cJSON_GetObjectItem(root, "speed")->valuedouble;

View File

@ -71,6 +71,7 @@ struct Weapon {
struct Entity { struct Entity {
int type; int type;
char name[MAX_NAME_LENGTH]; char name[MAX_NAME_LENGTH];
char defName[MAX_NAME_LENGTH];
int active; int active;
int id; int id;
int side; int side;