summaryrefslogtreecommitdiff
path: root/vehicle.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2005-02-04 14:24:23 +0000
committertruelight <truelight@openttd.org>2005-02-04 14:24:23 +0000
commit99f3fe4c07f60416da4c9747bdc423db88211764 (patch)
tree9b5dccb928528ebebcb07c1edd681e786d4e0f9f /vehicle.c
parentc7eda1b15e7f10a405f398dd230cb8ccff8164b8 (diff)
downloadopenttd-99f3fe4c07f60416da4c9747bdc423db88211764.tar.xz
(svn r1786) -Fix: unitnumber is increased to 16bit, so now you can have up to 5000
trains in one game (instead of the 240 which was the current value). Default max allowed vehicles per type is changed: Trains: 500 (old 80) Road: 500 (old 80) Ships: 200 (old 40) Aicraft: 300 (old 50) (Tnx to Celestar and Darkvater for checking the patch)
Diffstat (limited to 'vehicle.c')
-rw-r--r--vehicle.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/vehicle.c b/vehicle.c
index 4a0048267..9e56287b5 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -1762,9 +1762,9 @@ uint32 VehicleEnterTile(Vehicle *v, uint tile, int x, int y)
return result;
}
-uint GetFreeUnitNumber(byte type)
+UnitID GetFreeUnitNumber(byte type)
{
- uint unit_num = 0;
+ UnitID unit_num = 0;
Vehicle *u;
restart:
@@ -1784,7 +1784,8 @@ const byte _common_veh_desc[] = {
SLE_REF(Vehicle,next, REF_VEHICLE_OLD),
SLE_VAR(Vehicle,string_id, SLE_STRINGID),
- SLE_VAR(Vehicle,unitnumber, SLE_UINT8),
+ SLE_CONDVAR(Vehicle,unitnumber, SLE_FILE_U8 | SLE_VAR_U16, 0, 7),
+ SLE_CONDVAR(Vehicle,unitnumber, SLE_UINT16, 8, 255),
SLE_VAR(Vehicle,owner, SLE_UINT8),
SLE_CONDVAR(Vehicle,tile, SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
SLE_CONDVAR(Vehicle,tile, SLE_UINT32, 6, 255),