Complete.Org: Mailing Lists: Archives: freeciv-dev: February 1999:
Re: Fwd: Re: [Freeciv-Dev] A city doesn't have a mine beneath it
Home

Re: Fwd: Re: [Freeciv-Dev] A city doesn't have a mine beneath it

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv Mailing List <freeciv-dev@xxxxxxxxxxx>
Subject: Re: Fwd: Re: [Freeciv-Dev] A city doesn't have a mine beneath it
From: Andrew Donkin <ard@xxxxxxxxxxxxxxxxxx>
Date: 01 Mar 1999 12:03:28 +1300

lduperval at sprint.ca says:

> According to the Civ II book, any city built on Plains or Grasslands
> automatically has irrigation and roads. Any other square has roads and
> mining, if Mining is applicable.

Then I suggest the following.  I haven't armoured it against
hyphen-bashing because I'd prefer the learned folks on this list to look
at it (and pick holes in it) easily.

Most of it is a cleanup, but the pertinent part is in get_shield_tile():

-  if (spec_t & S_MINE) {
+  if ((spec_t & S_MINE) || (x == 2 && y == 2 && tile_t==type->mining_result)) {


Patch follows:


--- freeciv/common/city.c       Mon Feb 22 12:07:04 1999
+++ freeciv.ard/common/city.c   Mon Mar  1 11:54:59 1999
@@ -958,19 +958,20 @@
   int s=0;
   enum tile_special_type spec_t=map_get_special(pcity->x+x-2, pcity->y+y-2);
   enum tile_terrain_type tile_t=map_get_terrain(pcity->x+x-2, pcity->y+y-2);
-
+  struct tile_type *type = get_tile_type(tile_t);
   int gov=get_government(pcity->owner);
+
   if (city_celebrating(pcity))
     gov+=2;
   if (spec_t & S_SPECIAL)
-    s=get_tile_type(tile_t)->shield_special;
+    s=type->shield_special;
   else
-    s=get_tile_type(tile_t)->shield;
+    s=type->shield;

   if (x == 2 &&  y == 2 && !s) /* Always give a single shield on city square */
     s=1;

-  if (spec_t & S_MINE) {
+  if ((spec_t & S_MINE) || (x == 2 && y == 2 && tile_t==type->mining_result)) {
     s++;
     if (tile_t == T_HILLS)
       s+=2;
@@ -1052,9 +1053,9 @@
     gov+=2;

   if (spec_t & S_SPECIAL)
-    f=get_tile_type(tile_t)->food_special;
+    f=type->food_special;
   else
-    f=get_tile_type(tile_t)->food;
+    f=type->food;

   if (spec_t & S_IRRIGATION || (x==2 && y==2 && 
tile_t==type->irrigation_result)) {

-- 
_________________________________________________________________________
Andrew Donkin                                           Technical Support
School of Computing and Maths, Waikato University, Hamilton,  New Zealand

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