From 16bca58803c5ff76de20889bc064f22e5305b9ed Mon Sep 17 00:00:00 2001 From: jacopo grandi Date: Mon, 22 Feb 2021 16:28:34 +0100 Subject: blinking cursor and fix net --- gst/info.c | 2 ++ gst/units.c | 1 + gst/units.h | 1 + 3 files changed, 4 insertions(+) (limited to 'gst') diff --git a/gst/info.c b/gst/info.c index 2328df3..eab41a2 100644 --- a/gst/info.c +++ b/gst/info.c @@ -899,6 +899,7 @@ void info_template_add (infos *info, info_unit *temp) { } void info_load_army(struct army_ *ar, char *filename) { + strcpy(ar->name, filename); char buf[1024*64]; char pathname[64]; sprintf(pathname, "army/%s.txt", filename); int len = info_read_file(buf, pathname, 1024*64); @@ -908,6 +909,7 @@ void info_load_army(struct army_ *ar, char *filename) { } void info_save_army(struct army_ *ar, char *filename) { + strcpy(ar->name, filename); char pathname[64]; sprintf(pathname, "army/%s.txt", filename); FILE *f = fopen(pathname, "wb"); fwrite(ar, 1, sizeof(army), f); diff --git a/gst/units.c b/gst/units.c index b247e3c..b0ae2b0 100644 --- a/gst/units.c +++ b/gst/units.c @@ -20,6 +20,7 @@ void army_grid_init(army *ar) { void army_init (army *ar, map *m) { ar->uslen = 0; ar->sx = m->sx; ar->sy = m->sy; + strcpy(ar->name, "-"); army_grid_init(ar); } diff --git a/gst/units.h b/gst/units.h index 8e78d8d..d574b79 100644 --- a/gst/units.h +++ b/gst/units.h @@ -22,6 +22,7 @@ typedef struct army_ { unit **grid; int uslen; int sx, sy; + char name[32]; } army; -- cgit v1.2.3-54-g00ecf