Author: cazfi
Date: Sun Jan 10 08:45:41 2016
New Revision: 31427

URL: http://svn.gna.org/viewcvs/freeciv?rev=31427&view=rev
Log:
Barbarians may continue pillaging even when they have move points, so they 
sometimes finish it.

See bug #23305

Modified:
    branches/S2_6/ai/default/aiunit.c

Modified: branches/S2_6/ai/default/aiunit.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/ai/default/aiunit.c?rev=31427&r1=31426&r2=31427&view=diff
==============================================================================
--- branches/S2_6/ai/default/aiunit.c   (original)
+++ branches/S2_6/ai/default/aiunit.c   Sun Jan 10 08:45:41 2016
@@ -1694,6 +1694,13 @@
   struct city *pcity = NULL;
 
   CHECK_UNIT(punit);
+
+  /* Barbarians pillage, and might keep on doing that so they sometimes
+   * even finish it. */
+  if (punit->activity == ACTIVITY_PILLAGE && is_barbarian(pplayer)
+      && fc_rand(2) == 1) {
+    return;
+  }
 
   /* First find easy nearby enemies, anything better than pillage goes.
    * NB: We do not need to repeat dai_military_rampage, it is repeats itself


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

Reply via email to