Author: cazfi
Date: Sun Jan 10 08:45:36 2016
New Revision: 31426

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

See bug #23305

Modified:
    trunk/ai/default/aiunit.c

Modified: trunk/ai/default/aiunit.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/aiunit.c?rev=31426&r1=31425&r2=31426&view=diff
==============================================================================
--- trunk/ai/default/aiunit.c   (original)
+++ trunk/ai/default/aiunit.c   Sun Jan 10 08:45:36 2016
@@ -1697,6 +1697,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