Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] (PR#10571) Transform to Ocean/River
Home

[Freeciv-Dev] (PR#10571) Transform to Ocean/River

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: brett.albertson@xxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#10571) Transform to Ocean/River
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 17 Oct 2004 23:29:49 -0700
Reply-to: rt@xxxxxxxxxxx

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

> [jdorje - Mon Oct 18 06:27:09 2004]:
> 
> > [bretta - Sun Oct 17 03:27:56 2004]:
> > 
> > I had an engineer on a swamp with a river in it.  The menu choice for 
> > transform said:
> > 
> > Transform to Ocean/River   O
> > 
> > I'm pretty sure that an ocean can't have a river in it, unless you 
> > count the Gulf Stream.  :-)
> 
> Indeed.  I suppose this patch will fix it.  This change may be necessary
> for settlers.c too (eventually).

And, here's a version that actually compiles...


Index: client/gui-gtk-2.0/menu.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/menu.c,v
retrieving revision 1.43.2.1
diff -u -r1.43.2.1 menu.c
--- client/gui-gtk-2.0/menu.c   12 Oct 2004 06:18:42 -0000      1.43.2.1
+++ client/gui-gtk-2.0/menu.c   18 Oct 2004 06:28:47 -0000
@@ -1094,6 +1094,7 @@
                                             enum unit_activity activity)
 {
   Terrain_type_id old_terrain = ptile->terrain;
+  enum tile_special_type old_special = ptile->special;
   struct tile_type *ptype = get_tile_type(ptile->terrain);
   const char *text;
 
@@ -1102,19 +1103,21 @@
   case ACTIVITY_IRRIGATE:
     assert(ptype->irrigation_result != ptile->terrain
           && ptype->irrigation_result != T_NONE);
-    ptile->terrain = ptype->irrigation_result;
+    map_irrigate_tile(ptile);
     break;
+
   case ACTIVITY_MINE:
     assert(ptype->mining_result != ptile->terrain
           && ptype->mining_result != T_NONE);
-    ptile->terrain = ptype->mining_result;
+    map_mine_tile(ptile);
     break;
 
   case ACTIVITY_TRANSFORM:
     assert(ptype->transform_result != ptile->terrain
           && ptype->transform_result != T_NONE);
-    ptile->terrain = ptype->transform_result;
+    map_transform_tile(ptile);
     break;
+
   default:
     assert(0);
     return "-";
@@ -1122,7 +1125,10 @@
 
   text = map_get_tile_info_text(ptile);
 
+  /* Restore the original state of the tile. */
   ptile->terrain = old_terrain;
+  ptile->special = old_special;
+  reset_move_costs(ptile);
 
   return text;
 }

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