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

This patch removes the unused NO_SINK effect.

If someone could take a glance at the ai parts that would be good.

Also, this (and the trireme tech flag) patch both break network
compatibility by reordering enumerations.  This could be avoided but
it's easier IMO to just update the capstring when committing.

-jason

Index: common/effects.c
===================================================================
--- common/effects.c	(revision 12648)
+++ common/effects.c	(working copy)
@@ -61,7 +61,6 @@
   /* TODO: "Make_Content_Pct", */
   "Make_Happy",
   "No_Anarchy",
-  "No_Sink_Deep",
   "Nuke_Proof",
   /* TODO: "Pollu_Adj", */
   /* TODO: "Pollu_Pct", */
Index: common/effects.h
===================================================================
--- common/effects.h	(revision 12648)
+++ common/effects.h	(working copy)
@@ -48,7 +48,6 @@
   /* TODO: EFT_MAKE_CONTENT_PCT, */
   EFT_MAKE_HAPPY,
   EFT_NO_ANARCHY,
-  EFT_NO_SINK_DEEP,
   EFT_NUKE_PROOF,
   /* TODO: EFT_POLLU_ADJ, */
   /* TODO: EFT_POLLU_PCT, */
Index: ai/aiexplorer.c
===================================================================
--- ai/aiexplorer.c	(revision 12648)
+++ ai/aiexplorer.c	(working copy)
@@ -62,51 +62,6 @@
   return 50 + (50 / map.num_valid_dirs * (ocean - land));
 }
 
-/***************************************************************
-Is a tile likely to be coastline, given information that the 
-player actually has.
-***************************************************************/
-static bool is_likely_coastline(struct tile *ptile, struct player *pplayer)
-{
-  int likely = 50;
-  int t;
-
-  adjc_iterate(ptile, ptile1) {
-    if ((t = likely_ocean(ptile1, pplayer)) == 0) {
-      return TRUE;
-    }
-    /* If all t values are 50, likely stays at 50. If all approach zero,
-     * ie are unlikely to be ocean, the tile is likely to be coastline, so
-     * likely will approach 100. If all approach 100, likely will 
-     * approach zero. */
-    likely += (50 - t) / map.num_valid_dirs;
-    
-  } adjc_iterate_end;
-
-  return (likely > 50);
-}
-
-/***************************************************************
-Is there a chance that a trireme would be lost, given information that 
-the player actually has.
-***************************************************************/
-static bool is_likely_trireme_loss(struct tile *ptile, struct player *pplayer, 
-                             	   struct unit *punit)
-{
-  /*
-   * If we are in a city or next to land, we have no chance of losing
-   * the ship.  To make this really useful for ai planning purposes, we'd
-   * need to confirm that we can exist/move at the x,y location we are given.
-   */
-  if ((likely_ocean(ptile, pplayer) < 50) || 
-      is_likely_coastline(ptile, pplayer) ||
-      get_unit_bonus(punit, EFT_NO_SINK_DEEP) > 0) {
-    return FALSE;
-  } else {
-    return TRUE;
-  }
-}
-
 /**************************************************************************
 Return a value indicating how desirable it is to explore the given tile.
 In general, we want to discover unknown terrain of the opposite kind to
@@ -159,13 +114,11 @@
   int unknown = 0;
 
   /* First do some checks that would make a tile completely non-desirable.
-   * If we're a trireme and we could die at the given tile, or if there
+   * If there
    * is a city on the tile, or if the tile is not accessible, or if the 
    * tile is on a different continent, or if we're a barbarian and
    * the tile has a hut, don't go there. */
-  if ((unit_flag(punit, F_TRIREME) && 
-       is_likely_trireme_loss(ptile, pplayer, punit))
-      || tile_get_city(ptile)
+  if (tile_get_city(ptile)
       || (is_barbarian(pplayer) && tile_has_special(ptile, S_HUT))) {
     return 0;
   }
@@ -357,19 +310,6 @@
 	UNIT_LOG(LOG_DEBUG, punit, "recursively exploring...");
 	return ai_manage_explorer(punit);          
       } else {
-	/* Something went wrong. What to do but return?
-	 * Answer: if we're a trireme we could get to this point,
-	 * but only with a non-full complement of movement points,
-	 * in which case the goto code is simply requesting a
-	 * one turn delay (the next tile we would occupy is not safe).
-	 * In that case, we should just wait. */
-        if (unit_flag(punit, F_TRIREME) 
-            && (punit->moves_left != unit_move_rate(punit))) {
-          /* we're a trireme with non-full complement of movement points,
-           * so wait until next turn. */
-	  UNIT_LOG(LOG_DEBUG, punit, "done exploring (had to hold)...");
-          return TRUE;
-        }
 	UNIT_LOG(LOG_DEBUG, punit, "done exploring (all finished)...");
 	return FALSE;
       }
Index: ai/aicity.c
===================================================================
--- ai/aicity.c	(revision 12648)
+++ ai/aicity.c	(working copy)
@@ -462,9 +462,6 @@
   case EFT_REVEAL_CITIES:
   case EFT_NO_ANARCHY:
     break;  /* Useless for AI */
-  case EFT_NO_SINK_DEEP:
-    v += 15 + ai->stats.units.triremes * 5;
-    break;
   case EFT_NUKE_PROOF:
     if (ai->threats.nuclear) {
       v += pcity->size * unit_list_size(pcity->tile->units) * (capital + 1)
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to