From 018d30132eb6abe3673ba448c0932896a5b284da Mon Sep 17 00:00:00 2001 From: Steve Date: Sun, 1 Nov 2015 12:29:32 +0000 Subject: [PATCH] Added defName to entity, to allow printing of definition name of the entity. --- src/battle/fighterDefs.c | 1 + src/structs.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/battle/fighterDefs.c b/src/battle/fighterDefs.c index a141fcc..2f999c9 100644 --- a/src/battle/fighterDefs.c +++ b/src/battle/fighterDefs.c @@ -81,6 +81,7 @@ static void loadFighterDef(char *filename) root = cJSON_Parse(text); 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->shield = f->maxShield = cJSON_GetObjectItem(root, "shield")->valueint; f->speed = cJSON_GetObjectItem(root, "speed")->valuedouble; diff --git a/src/structs.h b/src/structs.h index 2a1dc69..add22ef 100644 --- a/src/structs.h +++ b/src/structs.h @@ -71,6 +71,7 @@ struct Weapon { struct Entity { int type; char name[MAX_NAME_LENGTH]; + char defName[MAX_NAME_LENGTH]; int active; int id; int side;