Re: (PR#11009) AI Hunts Own Units

"Benedict Adamson" <[email protected]> Mon, 15 Nov 2004 14:09:42 -0800
Newsgroups gmane.games.freeciv.ai
Message-ID <[email protected]>
<URL: http://rt.freeciv.org/Ticket/Display.html?id=11009 >

Jason Short wrote:
...
> Will you make a patch?
...

Here it is, for 2.0.0 beta.
PR11009,1047,2.0.0b3.patch (text/x-patch, 465 B)
--- vendor.freeciv.beta/ai/aihunt.c	2004-10-09 21:01:42.000000000 +0100
+++ freeciv.PR11009/ai/aihunt.c	2004-11-15 22:11:14.000000000 +0000
@@ -266,7 +266,8 @@
   assert(pplayer->is_alive);
 
   players_iterate(aplayer) {
-    if (!aplayer->is_alive || !is_player_dangerous(pplayer, aplayer)) {
+    if (aplayer == pplayer || !aplayer->is_alive
+	|| !is_player_dangerous(pplayer, aplayer)) {
       continue;
     }
     unit_list_iterate(aplayer->units, target) {