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;