Added defName to entity, to allow printing of definition name of the entity.
This commit is contained in:
parent
2a38221bcf
commit
018d30132e
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue