From 06b4b29ec8bb2049bd53a138804286f507a9e62c Mon Sep 17 00:00:00 2001 From: cazfi Date: Mon, 1 May 2017 17:46:10 +0000 Subject: [PATCH] Fix AI crash when there's no suitable ferryboat type Reported by Eric See gna bug #25628 git-svn-id: svn://svn.gna.org/svn/freeciv/branches/S2_6@35360 a0f10bec-cc02-0410-94fc-a9cfff90b4cd --- ai/default/daimilitary.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ai/default/daimilitary.c b/ai/default/daimilitary.c index 6ef92acdab..3adc3e6b25 100644 --- a/ai/default/daimilitary.c +++ b/ai/default/daimilitary.c @@ -1286,9 +1286,9 @@ static void kill_something_with(struct ai_type *ait, struct player *pplayer, /* We might need a new boat even if there are boats free, * if they are blockaded or in inland seas*/ fc_assert_ret(unit_class_get(myunit)->adv.sea_move != MOVE_FULL); - dai_choose_role_unit(ait, pplayer, pcity, choice, CT_ATTACKER, - L_FERRYBOAT, choice->want, TRUE); - if (dai_is_ferry_type(choice->value.utype, ait)) { + if (dai_choose_role_unit(ait, pplayer, pcity, choice, CT_ATTACKER, + L_FERRYBOAT, choice->want, TRUE) + && dai_is_ferry_type(choice->value.utype, ait)) { #ifdef FREECIV_DEBUG struct ai_plr *ai = dai_plr_data_get(ait, pplayer, NULL); -- 2.11.4.GIT