From e5f33829a0496c14e8d7b3ea4a87837884a2bdd7 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Fri, 29 Mar 2024 18:31:16 +0200
Subject: [PATCH 44/44] Increase max number of unit types to 300

Requested by markm

See RM #375

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 common/fc_types.h                | 2 +-
 common/networking/packets.def    | 2 +-
 data/alien/units.ruleset         | 2 +-
 data/civ1/units.ruleset          | 2 +-
 data/civ2/units.ruleset          | 2 +-
 data/civ2civ3/units.ruleset      | 2 +-
 data/classic/units.ruleset       | 2 +-
 data/goldkeep/units.ruleset      | 2 +-
 data/granularity/units.ruleset   | 2 +-
 data/multiplayer/units.ruleset   | 2 +-
 data/ruledit/comments-3.3.txt    | 2 +-
 data/sandbox/units.ruleset       | 2 +-
 data/stub/units.ruleset          | 2 +-
 data/webperimental/units.ruleset | 2 +-
 14 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/common/fc_types.h b/common/fc_types.h
index 5c7be0a593..8f32d76ebf 100644
--- a/common/fc_types.h
+++ b/common/fc_types.h
@@ -39,7 +39,7 @@ extern "C" {
 /* e.g. unit_types. Used in the network protocol. */
 #define MAX_NUM_ITEMS   200
 #define MAX_NUM_ADVANCES  400 /* Used in the network protocol. */
-#define MAX_NUM_UNITS     250 /* Used in the network protocol. */
+#define MAX_NUM_UNITS     300 /* Used in the network protocol. */
 #define MAX_NUM_BUILDINGS 200 /* Used in the network protocol. */
 #define MAX_NUM_TECH_LIST 10 /* Used in the network protocol. */
 #define MAX_NUM_UNIT_LIST 10 /* Used in the network protocol. */
diff --git a/common/networking/packets.def b/common/networking/packets.def
index db1fd147b3..6d7c93c2da 100644
--- a/common/networking/packets.def
+++ b/common/networking/packets.def
@@ -322,7 +322,7 @@ type TECH               = UINT16
 type TERRAIN            = uint8(Terrain_type_id)
 type TILE               = SINT32
 type UNIT               = UINT32
-type UNIT_TYPE          = uint8(Unit_type_id)
+type UNIT_TYPE          = uint16(Unit_type_id)
 type GOODS              = uint8(Goods_type_id)
 
 # other typedefs
diff --git a/data/alien/units.ruleset b/data/alien/units.ruleset
index ae0bac6cc3..5b6b1aa2d2 100644
--- a/data/alien/units.ruleset
+++ b/data/alien/units.ruleset
@@ -187,7 +187,7 @@ flags         = "Missile", "DoesntOccupyTile"
 ;
 ; Below: The individual unit types, one per section.
 ;
-; The number can be variable, up to 200.
+; The number can be variable, up to 300.
 ; However for the "official" rulesets, units should not be removed
 ; because that would break backward compatibility with savegames.
 ;
diff --git a/data/civ1/units.ruleset b/data/civ1/units.ruleset
index 9b6a8b406b..c4e3b64e94 100644
--- a/data/civ1/units.ruleset
+++ b/data/civ1/units.ruleset
@@ -163,7 +163,7 @@ flags         = "Missile", "Unreachable", "HutNothing"
 ;
 ; Below: The individual unit types, one per section.
 ;
-; The number can be variable, up to 200.
+; The number can be variable, up to 300.
 ; However for the "official" rulesets, units should not be removed
 ; because that would break backward compatibility with savegames.
 ;
diff --git a/data/civ2/units.ruleset b/data/civ2/units.ruleset
index 8fa0638a70..5f25e5b77e 100644
--- a/data/civ2/units.ruleset
+++ b/data/civ2/units.ruleset
@@ -181,7 +181,7 @@ flags         = "Unreachable", "DoesntOccupyTile", "HutFrighten"
 ;
 ; Below: The individual unit types, one per section.
 ;
-; The number can be variable, up to 200.
+; The number can be variable, up to 300.
 ; However for the "official" rulesets, units should not be removed
 ; because that would break backward compatibility with savegames.
 ;
diff --git a/data/civ2civ3/units.ruleset b/data/civ2civ3/units.ruleset
index 0a5d372fa9..b9d7b4da2b 100644
--- a/data/civ2civ3/units.ruleset
+++ b/data/civ2civ3/units.ruleset
@@ -225,7 +225,7 @@ flags         = "Unreachable", "DoesntOccupyTile", "CanPillage",
 ;
 ; Below: The individual unit types, one per section.
 ;
-; The number can be variable, up to 200.
+; The number can be variable, up to 300.
 ; However for the "official" rulesets, units should not be removed
 ; because that would break backward compatibility with savegames.
 ;
diff --git a/data/classic/units.ruleset b/data/classic/units.ruleset
index 3996e73fbd..1261dc88eb 100644
--- a/data/classic/units.ruleset
+++ b/data/classic/units.ruleset
@@ -191,7 +191,7 @@ flags         = "Unreachable", "DoesntOccupyTile", "HutFrighten"
 ;
 ; Below: The individual unit types, one per section.
 ;
-; The number can be variable, up to 200.
+; The number can be variable, up to 300.
 ; However for the "official" rulesets, units should not be removed
 ; because that would break backward compatibility with savegames.
 ;
diff --git a/data/goldkeep/units.ruleset b/data/goldkeep/units.ruleset
index fd12ac119e..fea2a4fa5e 100644
--- a/data/goldkeep/units.ruleset
+++ b/data/goldkeep/units.ruleset
@@ -203,7 +203,7 @@ flags         = "Unreachable", "DoesntOccupyTile", "HutFrighten"
 ;
 ; Below: The individual unit types, one per section.
 ;
-; The number can be variable, up to 200.
+; The number can be variable, up to 300.
 ; However for the "official" rulesets, units should not be removed
 ; because that would break backward compatibility with savegames.
 ;
diff --git a/data/granularity/units.ruleset b/data/granularity/units.ruleset
index c1e8cbeb48..5407857356 100644
--- a/data/granularity/units.ruleset
+++ b/data/granularity/units.ruleset
@@ -146,7 +146,7 @@ flags         = "BuildAnywhere"
 ;
 ; Below: The individual unit types, one per section.
 ;
-; The number can be variable, up to 200.
+; The number can be variable, up to 300.
 ; However for the "official" rulesets, units should not be removed
 ; because that would break backward compatibility with savegames.
 ;
diff --git a/data/multiplayer/units.ruleset b/data/multiplayer/units.ruleset
index 4f572b7c60..8a8f485ed4 100644
--- a/data/multiplayer/units.ruleset
+++ b/data/multiplayer/units.ruleset
@@ -191,7 +191,7 @@ flags         = "Unreachable", "DoesntOccupyTile", "HutFrighten"
 ;
 ; Below: The individual unit types, one per section.
 ;
-; The number can be variable, up to 200.
+; The number can be variable, up to 300.
 ; However for the "official" rulesets, units should not be removed
 ; because that would break backward compatibility with savegames.
 ;
diff --git a/data/ruledit/comments-3.3.txt b/data/ruledit/comments-3.3.txt
index 5cbe7034be..8e847e0660 100644
--- a/data/ruledit/comments-3.3.txt
+++ b/data/ruledit/comments-3.3.txt
@@ -310,7 +310,7 @@ utypes = "\
 ;\n\
 ; Below: The individual unit types, one per section.\n\
 ;\n\
-; The number can be variable, up to 200.\n\
+; The number can be variable, up to 300.\n\
 ; However for the \"official\" rulesets, units should not be removed\n\
 ; because that would break backward compatibility with savegames.\n\
 ;\n\
diff --git a/data/sandbox/units.ruleset b/data/sandbox/units.ruleset
index 8dcdeed3c1..ce6a21f409 100644
--- a/data/sandbox/units.ruleset
+++ b/data/sandbox/units.ruleset
@@ -238,7 +238,7 @@ flags         = "Unreachable", "DoesntOccupyTile", "CanPillage",
 ;
 ; Below: The individual unit types, one per section.
 ;
-; The number can be variable, up to 200.
+; The number can be variable, up to 300.
 ; However for the "official" rulesets, units should not be removed
 ; because that would break backward compatibility with savegames.
 ;
diff --git a/data/stub/units.ruleset b/data/stub/units.ruleset
index 589f55734e..9d7d025f33 100644
--- a/data/stub/units.ruleset
+++ b/data/stub/units.ruleset
@@ -120,7 +120,7 @@ flags         = ""
 ;
 ; Below: The individual unit types, one per section.
 ;
-; The number can be variable, up to 200.
+; The number can be variable, up to 300.
 ; However for the "official" rulesets, units should not be removed
 ; because that would break backward compatibility with savegames.
 ;
diff --git a/data/webperimental/units.ruleset b/data/webperimental/units.ruleset
index 7c3c99a275..5eac31e3cf 100644
--- a/data/webperimental/units.ruleset
+++ b/data/webperimental/units.ruleset
@@ -195,7 +195,7 @@ flags         = "Unreachable", "DoesntOccupyTile", "HutFrighten"
 ;
 ; Below: The individual unit types, one per section.
 ;
-; The number can be variable, up to 200.
+; The number can be variable, up to 300.
 ; However for the "official" rulesets, units should not be removed
 ; because that would break backward compatibility with savegames.
 ;
-- 
2.43.0

