summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ai/api/ai_types.hpp2
-rw-r--r--src/ai/api/ai_vehicle.hpp2
-rw-r--r--src/cargopacket.h4
-rw-r--r--src/script/squirrel.hpp7
-rw-r--r--src/vehicle_base.h3
-rw-r--r--src/vehicle_type.h4
6 files changed, 15 insertions, 7 deletions
diff --git a/src/ai/api/ai_types.hpp b/src/ai/api/ai_types.hpp
index 2eb629aba..7308a0452 100644
--- a/src/ai/api/ai_types.hpp
+++ b/src/ai/api/ai_types.hpp
@@ -97,7 +97,7 @@ typedef uint16 StringID; ///< The ID of a string.
typedef uint16 SubsidyID; ///< The ID of a subsidy.
typedef uint32 TileIndex; ///< The ID of a tile (just named differently).
typedef uint16 TownID; ///< The ID of a town.
-typedef uint16 VehicleID; ///< The ID of a vehicle.
+typedef uint32 VehicleID; ///< The ID of a vehicle.
/* Types we defined ourself, as the OpenTTD core doesn't have them (yet) */
typedef uint AIErrorType; ///< The types of errors inside the NoAI framework.
diff --git a/src/ai/api/ai_vehicle.hpp b/src/ai/api/ai_vehicle.hpp
index 126503e21..083e9da1c 100644
--- a/src/ai/api/ai_vehicle.hpp
+++ b/src/ai/api/ai_vehicle.hpp
@@ -97,7 +97,7 @@ public:
VS_INVALID = 0xFF, ///< An invalid vehicle state.
};
- static const VehicleID VEHICLE_INVALID = 0xFFFF; ///< Invalid VehicleID.
+ static const VehicleID VEHICLE_INVALID = 0xFFFFF; ///< Invalid VehicleID.
/**
* Checks whether the given vehicle is valid and owned by you.
diff --git a/src/cargopacket.h b/src/cargopacket.h
index dfd5e72d9..77f656bcf 100644
--- a/src/cargopacket.h
+++ b/src/cargopacket.h
@@ -23,8 +23,8 @@
typedef uint32 CargoPacketID;
struct CargoPacket;
-/** Type of the pool for cargo packets. */
-typedef Pool<CargoPacket, CargoPacketID, 1024, 1048576, true, false> CargoPacketPool;
+/** Type of the pool for cargo packets for a little over 16 million packets. */
+typedef Pool<CargoPacket, CargoPacketID, 1024, 0xFFF000, true, false> CargoPacketPool;
/** The actual pool with cargo packets */
extern CargoPacketPool _cargopacket_pool;
diff --git a/src/script/squirrel.hpp b/src/script/squirrel.hpp
index 43aaa11fa..ec9871d72 100644
--- a/src/script/squirrel.hpp
+++ b/src/script/squirrel.hpp
@@ -89,6 +89,12 @@ public:
* Adds a const to the stack. Depending on the current state this means
* either a const to a class or to the global space.
*/
+ void AddConst(const char *var_name, uint value) { this->AddConst(var_name, (int)value); }
+
+ /**
+ * Adds a const to the stack. Depending on the current state this means
+ * either a const to a class or to the global space.
+ */
void AddConst(const char *var_name, bool value);
/**
@@ -126,6 +132,7 @@ public:
void InsertResult(bool result);
void InsertResult(int result);
+ void InsertResult(uint result) { this->InsertResult((int)result); }
/**
* Call a method of an instance, in various flavors.
diff --git a/src/vehicle_base.h b/src/vehicle_base.h
index ea7d70bae..5b562db17 100644
--- a/src/vehicle_base.h
+++ b/src/vehicle_base.h
@@ -53,7 +53,8 @@ struct VehicleCache {
uint32 cached_var43; ///< Cache for NewGRF var 43
};
-typedef Pool<Vehicle, VehicleID, 512, 64000> VehiclePool;
+/** A vehicle pool for a little over 1 million vehicles. */
+typedef Pool<Vehicle, VehicleID, 512, 0xFF000> VehiclePool;
extern VehiclePool _vehicle_pool;
/* Some declarations of functions, so we can make them friendly */
diff --git a/src/vehicle_type.h b/src/vehicle_type.h
index 7e28df10a..dc283de16 100644
--- a/src/vehicle_type.h
+++ b/src/vehicle_type.h
@@ -14,7 +14,7 @@
#include "core/enum_type.hpp"
-typedef uint16 VehicleID;
+typedef uint32 VehicleID;
/** Available vehicle types. */
enum VehicleType {
@@ -45,7 +45,7 @@ struct BaseVehicle
VehicleTypeByte type; ///< Type of vehicle
};
-static const VehicleID INVALID_VEHICLE = 0xFFFF; ///< Constant representing a non-existing vehicle.
+static const VehicleID INVALID_VEHICLE = 0xFFFFF; ///< Constant representing a non-existing vehicle.
/** Pathfinding option states */
enum VehiclePathFinders {