Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2005:
[Freeciv-Dev] (PR#12550) [Patch] Fix H_HUTS
Home

[Freeciv-Dev] (PR#12550) [Patch] Fix H_HUTS

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#12550) [Patch] Fix H_HUTS
From: "Marko Lindqvist" <marko.lindqvist@xxxxxxxxxxx>
Date: Sat, 19 Mar 2005 15:11:31 -0800
Reply-to: bugs@xxxxxxxxxxx

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


  Checking if player can see hut seems to be broken in aiexplorer.c. 
map_is_known() is required no matter what ai_handicap(H_HUTS) returns 
and human players are considered _not_ to have this handicap.


  - ML


diff -Nurd -X.diff_ignore freeciv/ai/aiexplorer.c freeciv/ai/aiexplorer.c
--- freeciv/ai/aiexplorer.c     2005-03-20 00:00:49.640625000 +0200
+++ freeciv/ai/aiexplorer.c     2005-03-20 01:08:17.921875000 +0200
@@ -226,9 +226,11 @@
     desirable = 0;
   }
 
-  if ((!pplayer->ai.control || !ai_handicap(pplayer, H_HUTS))
-      && map_is_known(ptile, pplayer)
-      && map_has_special(ptile, S_HUT)) {
+  /* This cheats a bit, we always know if hut from fogged tile has
+   * been removed. */
+  if (map_has_special(ptile, S_HUT) &&
+      ((pplayer->ai.control && !ai_handicap(pplayer, H_HUTS))
+       || map_is_known(ptile, pplayer))) {
     /* we want to explore huts whenever we can,
      * even if doing so will not uncover any tiles. */
     desirable += HUT_SCORE;
diff -Nurd -X.diff_ignore freeciv/common/player.h freeciv/common/player.h
--- freeciv/common/player.h     2005-03-20 00:01:07.140625000 +0200
+++ freeciv/common/player.h     2005-03-20 00:33:29.421875000 +0200
@@ -50,7 +50,7 @@
   H_EXPERIMENTAL = 16,/* Enable experimental AI features (for testing) */
   H_RATES = 32,       /* Can't set its rates beyond government limits */
   H_TARGETS = 64,     /* Can't target anything it doesn't know exists */
-  H_HUTS = 128,       /* Doesn't know which unseen tiles have huts on them */
+  H_HUTS = 128,       /* Doesn't know which unknown tiles have huts on them */
   H_FOG = 256,        /* Can't see through fog of war */
   H_NOPLANES = 512,   /* Doesn't build air units */
   H_MAP = 1024,       /* Only knows map_is_known tiles */

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#12550) [Patch] Fix H_HUTS, Marko Lindqvist <=