Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2004:
[Freeciv-Dev] Re: (PR#9447) happyborders doesn't work?
Home

[Freeciv-Dev] Re: (PR#9447) happyborders doesn't work?

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#9447) happyborders doesn't work?
From: "Christian Knoke" <chrisk@xxxxxxxxx>
Date: Wed, 21 Jul 2004 00:25:42 -0700
Reply-to: rt@xxxxxxxxxxx

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

On Tue, Jul 20, 2004 at 08:29:37PM -0700, Jason Short wrote:
> 
> But there should be no unhappiness, since just 1 unit is outside of 
> borders.  Clearly happyborders is disabled.
> 
> If i start the server with ./ser and "show happyborders", the value is 
> shown to be zero, not the default.  All other options will have their 
> default value at this point.

happyborders is not initialized, and declared int not bool.

Christian

-- 
Christian Knoke            * * *            http://cknoke.de
* * * * * * * * *  Ceterum censeo Microsoft esse dividendum.

diff -r -u ../cvs/freeciv/common/game.c my/common/game.c
--- ../cvs/freeciv/common/game.c        2004-07-04 12:31:02.000000000 +0200
+++ my/common/game.c    2004-07-21 08:31:22.000000000 +0200
@@ -241,6 +241,7 @@
   game.fogofwar    = GAME_DEFAULT_FOGOFWAR;
   game.fogofwar_old= game.fogofwar;
   game.borders     = GAME_DEFAULT_BORDERS;
+  game.happyborders= GAME_DEFAULT_HAPPYBORDERS;
   game.slow_invasions = GAME_DEFAULT_SLOW_INVASIONS;
   game.auto_ai_toggle = GAME_DEFAULT_AUTO_AI_TOGGLE;
   game.notradesize    = GAME_DEFAULT_NOTRADESIZE;
diff -r -u ../cvs/freeciv/server/savegame.c my/server/savegame.c
--- ../cvs/freeciv/server/savegame.c    2004-07-21 07:54:49.000000000 +0200
+++ my/server/savegame.c        2004-07-21 08:33:17.000000000 +0200
@@ -2435,7 +2435,7 @@
 
     /* National borders setting. */
     game.borders = secfile_lookup_int_default(file, 0, "game.borders");
-    game.happyborders = secfile_lookup_int_default(file, FALSE, 
+    game.happyborders = secfile_lookup_bool_default(file, FALSE, 
                                                    "game.happyborders");
 
     /* Diplomacy. */
@@ -2890,7 +2890,7 @@
   secfile_insert_int(file, game.occupychance, "game.occupychance");
   secfile_insert_str(file, game.demography, "game.demography");
   secfile_insert_int(file, game.borders, "game.borders");
-  secfile_insert_int(file, game.happyborders, "game.happyborders");
+  secfile_insert_bool(file, game.happyborders, "game.happyborders");
   secfile_insert_int(file, game.diplomacy, "game.diplomacy");
   secfile_insert_int(file, game.watchtower_vision, "game.watchtower_vision");
   secfile_insert_int(file, game.watchtower_extra_vision, 
"game.watchtower_extra_vision");

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