aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-06-26 23:40:35 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-06-26 23:42:48 +0200
commit88713427f730001cd1c2a7046183c28c16262d1e (patch)
tree0632d6a790b6c1aa40b38bad328434393d8dbfc8 /src
parent272fd5381003e6e91a21b6f1c743d7cb11f1fc46 (diff)
downloadjancity-88713427f730001cd1c2a7046183c28c16262d1e.tar.gz
human_player.c: reset deselected instances
Diffstat (limited to 'src')
-rw-r--r--src/player/src/human_player.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/player/src/human_player.c b/src/player/src/human_player.c
index 221146d..ffc4fd4 100644
--- a/src/player/src/human_player.c
+++ b/src/player/src/human_player.c
@@ -59,6 +59,9 @@ static bool select_units(struct human_player *const h, const short x,
{
sel = h->sel;
h->n_sel = 1;
+
+ for (size_t i = 1; i < sizeof h->sel / sizeof *h->sel; i++)
+ h->sel[i].d.u = NULL;
}
else
{
@@ -123,6 +126,9 @@ static bool select_buildings(struct human_player *const h, const short x,
{
sel = h->sel;
h->n_sel = 1;
+
+ for (size_t i = 1; i < sizeof h->sel / sizeof *h->sel; i++)
+ h->sel[i].d.b = NULL;
}
else
{
@@ -176,6 +182,9 @@ static bool select_resources(struct human_player *const h, const short x,
{
sel = h->sel;
h->n_sel = 1;
+
+ for (size_t i = 1; i < sizeof h->sel / sizeof *h->sel; i++)
+ h->sel[i].d.r = NULL;
}
else
{