From ac599625da28a448a4f9ec655e4767e6436d0e16 Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 12 Oct 2013 16:31:55 +0000 Subject: [PATCH] (svn r25835) -Change: Increase the total number of object types from 256 to 64000. --- src/object_cmd.cpp | 3 ++- src/object_type.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index e6100c78d4..59fc3f5c43 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -205,7 +205,8 @@ CommandCost CmdBuildObject(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 { CommandCost cost(EXPENSES_PROPERTY); - ObjectType type = (ObjectType)GB(p1, 0, 8); + ObjectType type = (ObjectType)GB(p1, 0, 16); + if (type >= NUM_OBJECTS) return CMD_ERROR; uint8 view = GB(p2, 0, 2); const ObjectSpec *spec = ObjectSpec::Get(type); if (!spec->IsAvailable()) return CMD_ERROR; diff --git a/src/object_type.h b/src/object_type.h index 9716b360ec..1ebb24d534 100644 --- a/src/object_type.h +++ b/src/object_type.h @@ -24,7 +24,7 @@ static const ObjectType OBJECT_HQ = 4; ///< HeadQuarter of a play static const ObjectType NUM_OBJECTS_PER_GRF = 255; ///< Number of supported objects per NewGRF; limited to 255 to allow extending Action3 with an extended byte later on. static const ObjectType NEW_OBJECT_OFFSET = 5; ///< Offset for new objects -static const ObjectType NUM_OBJECTS = 256; ///< Number of supported objects overall +static const ObjectType NUM_OBJECTS = 64000; ///< Number of supported objects overall static const ObjectType INVALID_OBJECT_TYPE = 0xFFFF; ///< An invalid object /** Unique identifier for an object. */