From bd28b7465525911f9fbd78169037124fc0030b49 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 9 Sep 2020 18:03:20 +0200 Subject: [PATCH] Make all game actions take an ObjectEntryIndex where applicable (#12384) * Make all game actions take an ObjectEntryIndex where applicable * Update replays for parameter size change Co-authored-by: duncanspumpkin --- CMakeLists.txt | 4 ++-- openrct2.proj | 4 ++-- src/openrct2/actions/FootpathPlaceFromTrackAction.hpp | 4 ++-- src/openrct2/actions/FootpathSceneryPlaceAction.hpp | 4 ++-- src/openrct2/actions/RideCreateAction.hpp | 4 ++-- src/openrct2/actions/SmallSceneryPlaceAction.hpp | 4 ++-- src/openrct2/actions/WallPlaceAction.hpp | 4 ++-- src/openrct2/network/NetworkBase.cpp | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 721ba3ec20..41456a77d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,8 +44,8 @@ set(TITLE_SEQUENCE_SHA1 "304d13a126c15bf2c86ff13b81a2f2cc1856ac8d") set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v1.0.16/objects.zip") set(OBJECTS_SHA1 "ea8be00a7ab5a1e9369277f8f59f487bc588eb6a") -set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v0.0.17/replays.zip") -set(REPLAYS_SHA1 "8DD6D8DBDB1EA50ABCB3A1FB55D2800E13486F44") +set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v0.0.18/replays.zip") +set(REPLAYS_SHA1 "5B1C9A6E91B135A1EB629332BEA488A10CA6AD60") option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags.") option(WITH_TESTS "Build tests") diff --git a/openrct2.proj b/openrct2.proj index c646e3fa7d..5fc7f00b5c 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -48,8 +48,8 @@ 304d13a126c15bf2c86ff13b81a2f2cc1856ac8d https://github.com/OpenRCT2/objects/releases/download/v1.0.16/objects.zip ea8be00a7ab5a1e9369277f8f59f487bc588eb6a - https://github.com/OpenRCT2/replays/releases/download/v0.0.17/replays.zip - 8DD6D8DBDB1EA50ABCB3A1FB55D2800E13486F44 + https://github.com/OpenRCT2/replays/releases/download/v0.0.18/replays.zip + 5B1C9A6E91B135A1EB629332BEA488A10CA6AD60 diff --git a/src/openrct2/actions/FootpathPlaceFromTrackAction.hpp b/src/openrct2/actions/FootpathPlaceFromTrackAction.hpp index 20ad2e730c..e9233f8162 100644 --- a/src/openrct2/actions/FootpathPlaceFromTrackAction.hpp +++ b/src/openrct2/actions/FootpathPlaceFromTrackAction.hpp @@ -27,12 +27,12 @@ DEFINE_GAME_ACTION(FootpathPlaceFromTrackAction, GAME_COMMAND_PLACE_PATH_FROM_TR private: CoordsXYZ _loc; uint8_t _slope; - uint8_t _type; + ObjectEntryIndex _type; uint8_t _edges; public: FootpathPlaceFromTrackAction() = default; - FootpathPlaceFromTrackAction(const CoordsXYZ& loc, uint8_t slope, uint8_t type, uint8_t edges) + FootpathPlaceFromTrackAction(const CoordsXYZ& loc, uint8_t slope, ObjectEntryIndex type, uint8_t edges) : _loc(loc) , _slope(slope) , _type(type) diff --git a/src/openrct2/actions/FootpathSceneryPlaceAction.hpp b/src/openrct2/actions/FootpathSceneryPlaceAction.hpp index 95d5435f54..bfa6602a64 100644 --- a/src/openrct2/actions/FootpathSceneryPlaceAction.hpp +++ b/src/openrct2/actions/FootpathSceneryPlaceAction.hpp @@ -26,11 +26,11 @@ DEFINE_GAME_ACTION(FootpathSceneryPlaceAction, GAME_COMMAND_PLACE_FOOTPATH_SCENE { private: CoordsXYZ _loc; - uint8_t _pathItemType; + ObjectEntryIndex _pathItemType; public: FootpathSceneryPlaceAction() = default; - FootpathSceneryPlaceAction(const CoordsXYZ& loc, uint8_t pathItemType) + FootpathSceneryPlaceAction(const CoordsXYZ& loc, ObjectEntryIndex pathItemType) : _loc(loc) , _pathItemType(pathItemType) { diff --git a/src/openrct2/actions/RideCreateAction.hpp b/src/openrct2/actions/RideCreateAction.hpp index 8fd31ed8e3..f8f3240b9f 100644 --- a/src/openrct2/actions/RideCreateAction.hpp +++ b/src/openrct2/actions/RideCreateAction.hpp @@ -45,14 +45,14 @@ DEFINE_GAME_ACTION(RideCreateAction, GAME_COMMAND_CREATE_RIDE, RideCreateGameAct { private: int32_t _rideType{ RIDE_ID_NULL }; - int32_t _subType{ RIDE_ENTRY_INDEX_NULL }; + ObjectEntryIndex _subType{ RIDE_ENTRY_INDEX_NULL }; uint8_t _colour1{ 0xFF }; uint8_t _colour2{ 0xFF }; public: RideCreateAction() = default; - RideCreateAction(int32_t rideType, int32_t subType, int32_t colour1, int32_t colour2) + RideCreateAction(int32_t rideType, ObjectEntryIndex subType, int32_t colour1, int32_t colour2) : _rideType(rideType) , _subType(subType) , _colour1(colour1) diff --git a/src/openrct2/actions/SmallSceneryPlaceAction.hpp b/src/openrct2/actions/SmallSceneryPlaceAction.hpp index c4c834702a..c95e6d1b35 100644 --- a/src/openrct2/actions/SmallSceneryPlaceAction.hpp +++ b/src/openrct2/actions/SmallSceneryPlaceAction.hpp @@ -56,7 +56,7 @@ DEFINE_GAME_ACTION(SmallSceneryPlaceAction, GAME_COMMAND_PLACE_SCENERY, SmallSce private: CoordsXYZD _loc; uint8_t _quadrant; - uint16_t _sceneryType; + ObjectEntryIndex _sceneryType; uint8_t _primaryColour; uint8_t _secondaryColour; @@ -64,7 +64,7 @@ public: SmallSceneryPlaceAction() = default; SmallSceneryPlaceAction( - const CoordsXYZD& loc, uint8_t quadrant, uint8_t sceneryType, uint8_t primaryColour, uint8_t secondaryColour) + const CoordsXYZD& loc, uint8_t quadrant, ObjectEntryIndex sceneryType, uint8_t primaryColour, uint8_t secondaryColour) : _loc(loc) , _quadrant(quadrant) , _sceneryType(sceneryType) diff --git a/src/openrct2/actions/WallPlaceAction.hpp b/src/openrct2/actions/WallPlaceAction.hpp index 0c141bfad0..bb3af4d7a6 100644 --- a/src/openrct2/actions/WallPlaceAction.hpp +++ b/src/openrct2/actions/WallPlaceAction.hpp @@ -53,7 +53,7 @@ public: DEFINE_GAME_ACTION(WallPlaceAction, GAME_COMMAND_PLACE_WALL, WallPlaceActionResult) { private: - int32_t _wallType{ -1 }; + ObjectEntryIndex _wallType{ OBJECT_ENTRY_INDEX_NULL }; CoordsXYZ _loc; Direction _edge{ INVALID_DIRECTION }; int32_t _primaryColour{ COLOUR_BLACK }; @@ -65,7 +65,7 @@ public: WallPlaceAction() = default; WallPlaceAction( - int32_t wallType, const CoordsXYZ& loc, uint8_t edge, int32_t primaryColour, int32_t secondaryColour, + ObjectEntryIndex wallType, const CoordsXYZ& loc, uint8_t edge, int32_t primaryColour, int32_t secondaryColour, int32_t tertiaryColour) : _wallType(wallType) , _loc(loc) diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 544976190e..bc8875a397 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -33,7 +33,7 @@ // This string specifies which version of network stream current build uses. // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "5" +#define NETWORK_STREAM_VERSION "6" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static Peep* _pickup_peep = nullptr;