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

 Uninitialized extra cost from dangerous ocean drove valgrind crazy in
S2_2 and TRUNK. Of course, there is no such thing as dangerous ocean
in S2_2 and TRUNK. Fix attached.


 - ML

diff -Nurd -X.diff_ignore freeciv/ai/aitools.c freeciv/ai/aitools.c
--- freeciv/ai/aitools.c        2008-04-23 00:56:39.000000000 +0300
+++ freeciv/ai/aitools.c        2008-07-02 03:49:42.000000000 +0300
@@ -573,10 +573,6 @@
   const double p_killed = chance_killed_at(ptile, risk_cost, param);
   double danger = value * p_killed;
 
-  if (is_ocean_tile(ptile) && !is_safe_ocean(ptile)) {
-    danger += risk_cost->ocean_cost;
-  }
-
   /* Adjust for the fact that we might not stop at this tile,
    * and for our fearfulness */
   risk += danger * risk_cost->fearfulness;
diff -Nurd -X.diff_ignore freeciv/ai/aitools.h freeciv/ai/aitools.h
--- freeciv/ai/aitools.h        2007-11-27 21:57:32.000000000 +0200
+++ freeciv/ai/aitools.h        2008-07-02 03:49:26.000000000 +0300
@@ -46,8 +46,6 @@
 {
   double base_value;
   double fearfulness;
-  double ocean_cost;
-  double unsafe_terrain_cost;
   double enemy_zoc_cost;
 };
 
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to