Author: cazfi
Date: Mon May  1 19:45:55 2017
New Revision: 35358

URL: http://svn.gna.org/viewcvs/freeciv?rev=35358&view=rev
Log:
Fix AI crash when there's no suitable ferryboat type

Reported by Eric <koqebwix>

See gna bug #25628

Modified:
    trunk/ai/default/daimilitary.c

Modified: trunk/ai/default/daimilitary.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/daimilitary.c?rev=35358&r1=35357&r2=35358&view=diff
==============================================================================
--- trunk/ai/default/daimilitary.c      (original)
+++ trunk/ai/default/daimilitary.c      Mon May  1 19:45:55 2017
@@ -1287,9 +1287,9 @@
       /* We might need a new boat even if there are boats free,
        * if they are blockaded or in inland seas*/
       fc_assert_ret_val(unit_class_get(myunit)->adv.sea_move != MOVE_FULL, 
choice);
-      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);
 


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to