From 68dc48546defe3285a3b878f5f335bffffda9f2c Mon Sep 17 00:00:00 2001 From: cinnaboot Date: Sun, 3 Jun 2018 23:27:16 -0400 Subject: [PATCH] fix crash when starting selection outside grid --- src/hexgame.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hexgame.cpp b/src/hexgame.cpp index 4387473..e5ce1f3 100644 --- a/src/hexgame.cpp +++ b/src/hexgame.cpp @@ -116,7 +116,7 @@ void updateHexFill(int32 x, int32 y) { hex_info *hxi = getSingleHex(x, y); - if (hxi && (hxi != g_game_state->current_hex)) + if (hxi && (hxi != g_game_state->current_hex) && g_game_state->start_hex) { g_game_state->current_hex = hxi; int l = hex_distance(g_game_state->start_hex->hex, g_game_state->current_hex->hex); @@ -150,7 +150,7 @@ void updateHexLineDraw(int32 x, int32 y) { hex_info *hxi = getSingleHex(x, y); - if (hxi && (hxi != g_game_state->current_hex)) + if (hxi && (hxi != g_game_state->current_hex) && g_game_state->start_hex) { g_game_state->current_hex = hxi; vector hexLine = hex_linedraw(g_game_state->start_hex->hex, hxi->hex); @@ -189,7 +189,7 @@ void updateHexConeFill(int32 x, int32 y) { hex_info *hxi = getSingleHex(x, y); - if (hxi && (hxi != g_game_state->current_hex)) + if (hxi && (hxi != g_game_state->current_hex) && g_game_state->start_hex) { g_game_state->current_hex = hxi;