Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2004:
[Freeciv-Dev] (PR#8754) effects patch
Home

[Freeciv-Dev] (PR#8754) effects patch

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#8754) effects patch
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Wed, 19 May 2004 17:16:41 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8754 >

> [vasc - Wed May 19 22:57:42 2004]:
> 
> Here is the patch for using equiv_range in city_affected_by_wonder.

Turns out Hoover and Bach's only is continent wide in Civ1. Thanks go to
Jason for spotting it. The bonus is this makes the patch smaller...

diff -Nurd -X diff_ignore fc/common/city.c freeciv/common/city.c
--- fc/common/city.c    2004-05-19 23:49:13.536725376 +0100
+++ freeciv/common/city.c       2004-05-20 00:00:06.439469072 +0100
@@ -1080,47 +1080,18 @@
    * Otherwise the player who owns the city needs to have it to
    * get the effect.
    */
-  if (id==B_MANHATTEN) 
-    return (game.global_wonders[id] != 0);
-  
   tmp = player_find_city_by_id(city_owner(pcity), game.global_wonders[id]);
   if (!tmp)
     return FALSE;
-  switch (id) {
-  case B_ASMITHS:
-  case B_APOLLO:
-  case B_CURE:
-  case B_GREAT:
-  case B_WALL:
-  case B_HANGING:
-  case B_ORACLE:
-  case B_UNITED:
-  case B_WOMENS:
-  case B_DARWIN:
-  case B_LIGHTHOUSE:
-  case B_MAGELLAN:
-  case B_MICHELANGELO:
-  case B_SETI:
-  case B_PYRAMIDS:
-  case B_LIBERTY:
-  case B_SUNTZU:
-    return TRUE;
-  case B_ISAAC:
-  case B_COPERNICUS:
-  case B_SHAKESPEARE:
-  case B_COLLOSSUS:
-  case B_RICHARDS:
-    return FALSE;
-  case B_HOOVER:
-  case B_BACH:
-    if (improvement_variant(id)==1) {
+
+  switch (get_improvement_type(id)->equiv_range) {
+    case IR_PLAYER:
+      return TRUE;
+    case IR_ISLAND:
       return (map_get_continent(tmp->x, tmp->y) ==
              map_get_continent(pcity->x, pcity->y));
-    } else {
-      return TRUE;
-    }
-  default:
-    return FALSE;
+    default:
+      return FALSE;
   }
 }
 

[Prev in Thread] Current Thread [Next in Thread]