Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2004:
[Freeciv-Dev] Re: (PR#8669) killstack should be a boolean
Home

[Freeciv-Dev] Re: (PR#8669) killstack should be a boolean

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#8669) killstack should be a boolean
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 5 May 2004 15:20:42 -0700
Reply-to: rt@xxxxxxxxxxx

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

Jason Short wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=8669 >
> 
> game.rgame.killstack should be a boolean.
> 
> This means changing the ruleset loading code, packet code, and user 
> code.  All should become simpler.

Here's the patch.  Actually only a little of it becomes simpler.

jason

Index: common/capstr.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/capstr.c,v
retrieving revision 1.164
diff -u -r1.164 capstr.c
--- common/capstr.c     14 Apr 2004 11:19:44 -0000      1.164
+++ common/capstr.c     5 May 2004 22:19:54 -0000
@@ -77,7 +77,7 @@
 #define CAPABILITY "+1.14.delta +last_turns_shield_surplus veteran +orders " \
                    "+starter +union +iso_maps +orders2client " \
                    "+change_production +tilespec1 +no_earth +trans " \
-                   "+want_hack invasions killstack bombard"
+                   "+want_hack invasions bombard +killstack2"
 
 /* "+1.14.delta" is the new delta protocol for 1.14.0-dev.
  *
@@ -111,7 +111,8 @@
  * "invasions" means ground units moving from ocean to land now lose all
  * their movement; changable by ruleset option.
  * 
- * "killstack" means ruleset option to ignore unit killstack effect
+ * "killstack2" means ruleset option to ignore unit killstack effect, and now
+ * it's a boolean.
  *
  * "bombard" means units support the bombard ability.
  */
Index: common/combat.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/combat.c,v
retrieving revision 1.41
diff -u -r1.41 combat.c
--- common/combat.c     4 May 2004 17:40:26 -0000       1.41
+++ common/combat.c     5 May 2004 22:19:54 -0000
@@ -668,5 +668,5 @@
   return !(map_get_city(x, y) != NULL
            || map_has_special(x, y, S_FORTRESS)
            || map_has_special(x, y, S_AIRBASE)
-           || game.rgame.killstack == 0);
+           || !game.rgame.killstack);
 }
Index: common/game.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/game.h,v
retrieving revision 1.135
diff -u -r1.135 game.h
--- common/game.h       24 Apr 2004 17:32:47 -0000      1.135
+++ common/game.h       5 May 2004 22:19:54 -0000
@@ -205,7 +205,7 @@
      */
     int global_init_techs[MAX_NUM_TECH_LIST];
 
-    int killstack;
+    bool killstack;
   } rgame;
   
   struct {
Index: common/packets.def
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/packets.def,v
retrieving revision 1.21
diff -u -r1.21 packets.def
--- common/packets.def  24 Apr 2004 17:32:47 -0000      1.21
+++ common/packets.def  5 May 2004 22:19:55 -0000
@@ -971,7 +971,7 @@
   UINT8 tech_leakage;
   TECH_LIST global_init_techs[MAX_NUM_TECH_LIST];
 
-  UINT8 killstack; add-cap(killstack)
+  BOOL killstack;
 
   UINT8 trireme_loss_chance[MAX_VET_LEVELS]; add-cap(veteran)
   UINT8 work_veteran_chance[MAX_VET_LEVELS]; add-cap(veteran)
Index: server/ruleset.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/ruleset.c,v
retrieving revision 1.169
diff -u -r1.169 ruleset.c
--- server/ruleset.c    14 Apr 2004 11:19:45 -0000      1.169
+++ server/ruleset.c    5 May 2004 22:19:55 -0000
@@ -2680,13 +2680,7 @@
                   game.rgame.global_init_techs, filename);
 
   /* Enable/Disable killstack */
-  game.rgame.killstack = secfile_lookup_int(&file, "combat_rules.killstack");
-  if (game.rgame.killstack != 0 && game.rgame.killstack != 1) {
-    freelog(LOG_ERROR, "Bad value %i for killstack. Using 1.",
-           game.rgame.killstack);
-    game.rgame.killstack = 1;
-  }
-   
+  game.rgame.killstack = secfile_lookup_bool(&file, "combat_rules.killstack");
        
   section_file_check_unused(&file, filename);
   section_file_free(&file);

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#8669) killstack should be a boolean, Jason Short <=