Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] Re: (PR#9686) technology transfer = server crash
Home

[Freeciv-Dev] Re: (PR#9686) technology transfer = server crash

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeze@xxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#9686) technology transfer = server crash
From: "Marko Lindqvist" <marko.lindqvist@xxxxxxxxxxx>
Date: Thu, 12 Aug 2004 11:52:44 -0700
Reply-to: rt@xxxxxxxxxxx

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

Marko Lindqvist wrote:
>   Are A_UNSET, A_FUTURE and A_NOINFO really required to be less than 
> A_LAST or can we make them bigger?

  Attached, untested, patch takes easiest route. It just lowers limit 
for techs to load from ruleset.
  IMHO we should allow round number of 200 user (ruleset author) visible 
techs. Now we are saving techs by name, changing those special tech 
codes (A_NOINFO ... A_LAST) wouldn't even cause additional savegame 
incompatibilities?


   - Caz


diff -Nurd freeciv/common/tech.h freeciv/common/tech.h
--- freeciv/common/tech.h       2004-08-12 18:04:11.187500000 +0300
+++ freeciv/common/tech.h       2004-08-12 21:41:55.859375000 +0300
@@ -32,6 +32,7 @@
 #define A_UNSET (A_LAST-1)
 #define A_FUTURE (A_LAST-2)
 #define A_NOINFO (A_LAST-3)
+#define A_LAST_REAL A_NOINFO
 
 /*
    A_NONE is the root tech. All players always know this tech. It is
diff -Nurd freeciv/data/civ1/techs.ruleset freeciv/data/civ1/techs.ruleset
--- freeciv/data/civ1/techs.ruleset     2004-08-12 18:04:12.093750000 +0300
+++ freeciv/data/civ1/techs.ruleset     2004-08-12 21:41:55.890625000 +0300
@@ -12,7 +12,7 @@
 options="1.9"
 
 ; Below: The individual advances, one per section.
-; The number can be variable, up to 199.
+; The number can be variable, up to 196.
 ;
 ; The actual tag used (the * in [advance_*]) does not matter, except 
 ; it must be unique within this file, and it may be used in debug 
diff -Nurd freeciv/data/civ2/techs.ruleset freeciv/data/civ2/techs.ruleset
--- freeciv/data/civ2/techs.ruleset     2004-08-12 18:04:12.406250000 +0300
+++ freeciv/data/civ2/techs.ruleset     2004-08-12 21:41:55.906250000 +0300
@@ -12,7 +12,7 @@
 options="1.9"
 
 ; Below: The individual advances, one per section.
-; The number can be variable, up to 199.
+; The number can be variable, up to 196.
 ;
 ; The actual tag used (the * in [advance_*]) does not matter, except 
 ; it must be unique within this file, and it may be used in debug 
diff -Nurd freeciv/data/default/techs.ruleset freeciv/data/default/techs.ruleset
--- freeciv/data/default/techs.ruleset  2004-08-12 18:04:12.890625000 +0300
+++ freeciv/data/default/techs.ruleset  2004-08-12 21:41:55.906250000 +0300
@@ -12,7 +12,7 @@
 options="1.9"
 
 ; Below: The individual advances, one per section.
-; The number can be variable, up to 199.
+; The number can be variable, up to 196.
 ;
 ; The actual tag used (the * in [advance_*]) does not matter, except 
 ; it must be unique within this file, and it may be used in debug 
diff -Nurd freeciv/data/history/techs.ruleset freeciv/data/history/techs.ruleset
--- freeciv/data/history/techs.ruleset  2004-08-12 18:04:37.140625000 +0300
+++ freeciv/data/history/techs.ruleset  2004-08-12 21:41:55.937500000 +0300
@@ -12,7 +12,7 @@
 options="1.9"
 
 ; Below: The individual advances, one per section.
-; The number can be variable, up to 199.
+; The number can be variable, up to 196.
 ;
 ; The actual tag used (the * in [advance_*]) does not matter, except 
 ; it must be unique within this file, and it may be used in debug 
diff -Nurd freeciv/server/ruleset.c freeciv/server/ruleset.c
--- freeciv/server/ruleset.c    2004-08-12 18:04:49.687500000 +0300
+++ freeciv/server/ruleset.c    2004-08-12 21:42:20.640625000 +0300
@@ -516,9 +516,9 @@
     exit(EXIT_FAILURE);
   }
 
-  if(num_techs + A_FIRST > A_LAST) {
+  if(num_techs + A_FIRST > A_LAST_REAL) {
     freelog(LOG_FATAL, "Too many advances (%d, max %d) (%s)",
-           num_techs, A_LAST-A_FIRST, filename);
+           num_techs, A_LAST_REAL-A_FIRST, filename);
     exit(EXIT_FAILURE);
   }
 

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