human_player.c: reset deselected instances

This commit is contained in:
Xavier Del Campo Romero 2022-06-26 23:40:35 +02:00
parent 7196c6a0cc
commit 4305732e0a
1 changed files with 9 additions and 0 deletions

View File

@ -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
{