human_player_gui.c: fix segfault when selecting one unit

Checking against `sel` is just plain wrong, since it always expected to
be non-NULL, since `h->sel` is an array defined in `struct
human_player`. Instead, `sel->d.i` is the pointer that should be
checked.
This commit is contained in:
Xavier Del Campo Romero 2022-06-27 21:43:29 +02:00
parent e869bfd0f6
commit a746ecd0b6
1 changed files with 1 additions and 1 deletions

View File

@ -206,7 +206,7 @@ static int render_sel_single(const struct human_player *const h,
{
const struct sel_instance *const sel = &h->sel[i];
if (sel)
if (sel->d.i)
{
switch (sel->type)
{