Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2003:
[Freeciv-Dev] Re: (PR#4765) "dumb" city values aren't saved
Home

[Freeciv-Dev] Re: (PR#4765) "dumb" city values aren't saved

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#4765) "dumb" city values aren't saved
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 6 Aug 2003 00:43:31 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Jason Short wrote:
> Doh.  The 'happy' and 'unhappy' fields of the player dumb city are not 
> saved in the savegame.

And a patch.

jason

? rc
Index: server/savegame.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/savegame.c,v
retrieving revision 1.129
diff -u -r1.129 savegame.c
--- server/savegame.c   2003/08/05 03:44:34     1.129
+++ server/savegame.c   2003/08/06 07:42:12
@@ -1253,6 +1253,10 @@
        pdcity->has_walls = secfile_lookup_bool(file, 
"player%d.dc%d.has_walls", plrno, j);    
        pdcity->occupied = secfile_lookup_bool_default(file, FALSE,
                                        "player%d.dc%d.occupied", plrno, j);
+       pdcity->happy = secfile_lookup_bool_default(file, FALSE,
+                                       "player%d.dc%d.happy", plrno, j);
+       pdcity->unhappy = secfile_lookup_bool_default(file, FALSE,
+                                       "player%d.dc%d.unhappy", plrno, j);
        pdcity->owner = secfile_lookup_int(file, "player%d.dc%d.owner", plrno, 
j);
        map_get_player_tile(x, y, plr)->city = pdcity;
        alloc_id(pdcity->id);
@@ -1677,6 +1681,10 @@
                             "player%d.dc%d.has_walls", plrno, i);
          secfile_insert_bool(file, pdcity->occupied,
                              "player%d.dc%d.occupied", plrno, i);
+         secfile_insert_bool(file, pdcity->happy,
+                             "player%d.dc%d.happy", plrno, i);
+         secfile_insert_bool(file, pdcity->unhappy,
+                             "player%d.dc%d.unhappy", plrno, i);
          secfile_insert_int(file, pdcity->owner, "player%d.dc%d.owner",
                             plrno, i);
          i++;

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