Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2005:
[Freeciv-Dev] Re: (PR#13778) [Patch] Fix to ai_select_tech() crash
Home

[Freeciv-Dev] Re: (PR#13778) [Patch] Fix to ai_select_tech() crash

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] Re: (PR#13778) [Patch] Fix to ai_select_tech() crash
From: "Marko Lindqvist" <marko.lindqvist@xxxxxxxxxxx>
Date: Thu, 25 Aug 2005 11:20:33 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13778 >

Marko Lindqvist wrote:
>   ai_select_tech() sometimes sets want for all available techs to zero 
> (this is somewhat suspicios in itself). As a result, it returns A_UNSET 
> as wanted tech.

  Previous version still returned A_NONE in these situations.


  - ML

diff -Nurd -X.diff_ignore freeciv/ai/aitech.c freeciv/ai/aitech.c
--- freeciv/ai/aitech.c 2005-08-25 18:55:33.625000000 +0300
+++ freeciv/ai/aitech.c 2005-08-25 20:56:07.593750000 +0300
@@ -64,6 +64,10 @@
 
   memset(values, 0, sizeof(values));
   memset(goal_values, 0, sizeof(goal_values));
+  values[A_UNSET] = -1;
+  values[A_NONE] = -1;
+  goal_values[A_UNSET] = -1;
+  goal_values[A_NONE] = -1;
 
   /* Fill in values for the techs: want of the tech 
    * + average want of those we will discover en route */

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#13778) [Patch] Fix to ai_select_tech() crash, Marko Lindqvist <=