From 63e7f7a990a69e6afe116ec22e9f662507b4c0ba Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Sat, 9 Mar 2019 08:02:09 +0000 Subject: [PATCH 1/4] Use correct error messages with can_construct_with_clear Pass correct parameters to the function --- src/openrct2/actions/LandSetHeightAction.hpp | 2 +- src/openrct2/actions/MazeSetTrackAction.hpp | 4 +--- src/openrct2/actions/PlaceParkEntranceAction.hpp | 2 +- src/openrct2/actions/RideEntranceExitPlaceAction.hpp | 2 +- src/openrct2/actions/SmallSceneryPlaceAction.hpp | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/openrct2/actions/LandSetHeightAction.hpp b/src/openrct2/actions/LandSetHeightAction.hpp index 2d22a8a3a8..5e590722e5 100644 --- a/src/openrct2/actions/LandSetHeightAction.hpp +++ b/src/openrct2/actions/LandSetHeightAction.hpp @@ -123,7 +123,7 @@ public: _coords.x, _coords.y, _height, zCorner, &map_set_land_height_clear_func, { 0b1111, 0 }, 0, nullptr, CREATE_CROSSING_MODE_NONE)) { - return std::make_unique(GA_ERROR::DISALLOWED, gGameCommandErrorText); + return std::make_unique(GA_ERROR::DISALLOWED, STR_NONE, gGameCommandErrorText, gCommonFormatArgs); } tileElement = CheckUnremovableObstructions(surfaceElement, zCorner); diff --git a/src/openrct2/actions/MazeSetTrackAction.hpp b/src/openrct2/actions/MazeSetTrackAction.hpp index dbe205bd40..4df00ae4f1 100644 --- a/src/openrct2/actions/MazeSetTrackAction.hpp +++ b/src/openrct2/actions/MazeSetTrackAction.hpp @@ -150,9 +150,7 @@ public: if (!map_can_construct_at(floor2(_x, 32), floor2(_y, 32), baseHeight, clearanceHeight, { 0b1111, 0 })) { - res->Error = GA_ERROR::NO_CLEARANCE; - res->ErrorMessage = STR_NONE; - return res; + return MakeResult(GA_ERROR::NO_CLEARANCE, res->ErrorTitle, gGameCommandErrorText, gCommonFormatArgs); } if (gMapGroundFlags & ELEMENT_IS_UNDERWATER) diff --git a/src/openrct2/actions/PlaceParkEntranceAction.hpp b/src/openrct2/actions/PlaceParkEntranceAction.hpp index 9c1b47335c..16be0420a3 100644 --- a/src/openrct2/actions/PlaceParkEntranceAction.hpp +++ b/src/openrct2/actions/PlaceParkEntranceAction.hpp @@ -101,7 +101,7 @@ public: if (!map_can_construct_at(entranceLoc.x, entranceLoc.y, zLow, zHigh, { 0b1111, 0 })) { - return std::make_unique(GA_ERROR::NO_CLEARANCE, STR_CANT_BUILD_PARK_ENTRANCE_HERE, STR_NONE); + return std::make_unique(GA_ERROR::NO_CLEARANCE, STR_CANT_BUILD_PARK_ENTRANCE_HERE, gGameCommandErrorText, gCommonFormatArgs); } // Check that entrance element does not already exist at this location diff --git a/src/openrct2/actions/RideEntranceExitPlaceAction.hpp b/src/openrct2/actions/RideEntranceExitPlaceAction.hpp index 11dd51083f..0aa1f59f7e 100644 --- a/src/openrct2/actions/RideEntranceExitPlaceAction.hpp +++ b/src/openrct2/actions/RideEntranceExitPlaceAction.hpp @@ -186,7 +186,7 @@ public: int8_t clear_z = (z / 8) + (_isExit ? 5 : 7); auto cost = MONEY32_UNDEFINED; if (!map_can_construct_with_clear_at( - _loc.x, _loc.y, z / 8, clear_z, &map_place_non_scenery_clear_func, { 0b1111, 0 }, GetFlags(), &cost, + _loc.x, _loc.y, z / 8, clear_z, &map_place_non_scenery_clear_func, { 0b1111, 0 }, GetFlags() | GAME_COMMAND_FLAG_APPLY, &cost, CREATE_CROSSING_MODE_NONE)) { return MakeResult(GA_ERROR::NO_CLEARANCE, errorTitle, gGameCommandErrorText, gCommonFormatArgs); diff --git a/src/openrct2/actions/SmallSceneryPlaceAction.hpp b/src/openrct2/actions/SmallSceneryPlaceAction.hpp index 0495f82c38..093191a65d 100644 --- a/src/openrct2/actions/SmallSceneryPlaceAction.hpp +++ b/src/openrct2/actions/SmallSceneryPlaceAction.hpp @@ -375,7 +375,7 @@ public: money32 clearCost = 0; if (!map_can_construct_with_clear_at( - _loc.x, _loc.y, zLow, zHigh, &map_place_scenery_clear_func, quarterTile, GetFlags(), &clearCost, + _loc.x, _loc.y, zLow, zHigh, &map_place_scenery_clear_func, quarterTile, GetFlags() | GAME_COMMAND_FLAG_APPLY, &clearCost, CREATE_CROSSING_MODE_NONE)) { return MakeResult(GA_ERROR::DISALLOWED, STR_CANT_POSITION_THIS_HERE, gGameCommandErrorText, gCommonFormatArgs); From a3703cf2c0e1a8e1ec7b3f71f8d9fc7a22aeaa3c Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Sat, 9 Mar 2019 08:07:25 +0000 Subject: [PATCH 2/4] Fix #8736. Add error title to ride create --- src/openrct2/actions/RideCreateAction.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/actions/RideCreateAction.hpp b/src/openrct2/actions/RideCreateAction.hpp index 4b52021b91..ccab3c90af 100644 --- a/src/openrct2/actions/RideCreateAction.hpp +++ b/src/openrct2/actions/RideCreateAction.hpp @@ -34,7 +34,7 @@ public: { } RideCreateGameActionResult(GA_ERROR error, rct_string_id message) - : GameActionResult(error, message) + : GameActionResult(error, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, message) { } From 904bb0b6e9370386b54ffb51637b5b3cf3037d18 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Sat, 9 Mar 2019 09:01:34 +0000 Subject: [PATCH 3/4] Fix formatting --- src/openrct2/actions/LandSetHeightAction.hpp | 3 ++- src/openrct2/actions/PlaceParkEntranceAction.hpp | 3 ++- src/openrct2/actions/RideEntranceExitPlaceAction.hpp | 4 ++-- src/openrct2/actions/SmallSceneryPlaceAction.hpp | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/openrct2/actions/LandSetHeightAction.hpp b/src/openrct2/actions/LandSetHeightAction.hpp index 5e590722e5..0e505602e8 100644 --- a/src/openrct2/actions/LandSetHeightAction.hpp +++ b/src/openrct2/actions/LandSetHeightAction.hpp @@ -123,7 +123,8 @@ public: _coords.x, _coords.y, _height, zCorner, &map_set_land_height_clear_func, { 0b1111, 0 }, 0, nullptr, CREATE_CROSSING_MODE_NONE)) { - return std::make_unique(GA_ERROR::DISALLOWED, STR_NONE, gGameCommandErrorText, gCommonFormatArgs); + return std::make_unique( + GA_ERROR::DISALLOWED, STR_NONE, gGameCommandErrorText, gCommonFormatArgs); } tileElement = CheckUnremovableObstructions(surfaceElement, zCorner); diff --git a/src/openrct2/actions/PlaceParkEntranceAction.hpp b/src/openrct2/actions/PlaceParkEntranceAction.hpp index 16be0420a3..ade56a24c0 100644 --- a/src/openrct2/actions/PlaceParkEntranceAction.hpp +++ b/src/openrct2/actions/PlaceParkEntranceAction.hpp @@ -101,7 +101,8 @@ public: if (!map_can_construct_at(entranceLoc.x, entranceLoc.y, zLow, zHigh, { 0b1111, 0 })) { - return std::make_unique(GA_ERROR::NO_CLEARANCE, STR_CANT_BUILD_PARK_ENTRANCE_HERE, gGameCommandErrorText, gCommonFormatArgs); + return std::make_unique( + GA_ERROR::NO_CLEARANCE, STR_CANT_BUILD_PARK_ENTRANCE_HERE, gGameCommandErrorText, gCommonFormatArgs); } // Check that entrance element does not already exist at this location diff --git a/src/openrct2/actions/RideEntranceExitPlaceAction.hpp b/src/openrct2/actions/RideEntranceExitPlaceAction.hpp index 0aa1f59f7e..7c584689d2 100644 --- a/src/openrct2/actions/RideEntranceExitPlaceAction.hpp +++ b/src/openrct2/actions/RideEntranceExitPlaceAction.hpp @@ -186,8 +186,8 @@ public: int8_t clear_z = (z / 8) + (_isExit ? 5 : 7); auto cost = MONEY32_UNDEFINED; if (!map_can_construct_with_clear_at( - _loc.x, _loc.y, z / 8, clear_z, &map_place_non_scenery_clear_func, { 0b1111, 0 }, GetFlags() | GAME_COMMAND_FLAG_APPLY, &cost, - CREATE_CROSSING_MODE_NONE)) + _loc.x, _loc.y, z / 8, clear_z, &map_place_non_scenery_clear_func, { 0b1111, 0 }, + GetFlags() | GAME_COMMAND_FLAG_APPLY, &cost, CREATE_CROSSING_MODE_NONE)) { return MakeResult(GA_ERROR::NO_CLEARANCE, errorTitle, gGameCommandErrorText, gCommonFormatArgs); } diff --git a/src/openrct2/actions/SmallSceneryPlaceAction.hpp b/src/openrct2/actions/SmallSceneryPlaceAction.hpp index 093191a65d..7cc9052de1 100644 --- a/src/openrct2/actions/SmallSceneryPlaceAction.hpp +++ b/src/openrct2/actions/SmallSceneryPlaceAction.hpp @@ -375,8 +375,8 @@ public: money32 clearCost = 0; if (!map_can_construct_with_clear_at( - _loc.x, _loc.y, zLow, zHigh, &map_place_scenery_clear_func, quarterTile, GetFlags() | GAME_COMMAND_FLAG_APPLY, &clearCost, - CREATE_CROSSING_MODE_NONE)) + _loc.x, _loc.y, zLow, zHigh, &map_place_scenery_clear_func, quarterTile, GetFlags() | GAME_COMMAND_FLAG_APPLY, + &clearCost, CREATE_CROSSING_MODE_NONE)) { return MakeResult(GA_ERROR::DISALLOWED, STR_CANT_POSITION_THIS_HERE, gGameCommandErrorText, gCommonFormatArgs); } From 0b989710b5e53b26c684a0601e471d67ac08bb76 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Sat, 9 Mar 2019 18:08:20 +0000 Subject: [PATCH 4/4] Increment network version --- src/openrct2/network/Network.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/network/Network.cpp b/src/openrct2/network/Network.cpp index 319cea2360..2653afa75a 100644 --- a/src/openrct2/network/Network.cpp +++ b/src/openrct2/network/Network.cpp @@ -31,7 +31,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 "55" +#define NETWORK_STREAM_VERSION "56" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static Peep* _pickup_peep = nullptr;