aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-06-27 21:43:29 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-06-27 21:43:32 +0200
commitd28a7485213698f1ec220d4b9d290dc6c9b9a0a7 (patch)
treed2f2dde83c9b39bd187071bd240c3941c02a7429 /src
parentbac711c5b36a2491c2bb3bb44d3fac6166a06277 (diff)
downloadjancity-d28a7485213698f1ec220d4b9d290dc6c9b9a0a7.tar.gz
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.
Diffstat (limited to 'src')
-rw-r--r--src/player/src/human_player_gui.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/player/src/human_player_gui.c b/src/player/src/human_player_gui.c
index b5caeea..ea39bca 100644
--- a/src/player/src/human_player_gui.c
+++ b/src/player/src/human_player_gui.c
@@ -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)
{