diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 5269239a1f..d455b561c9 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -3695,6 +3695,7 @@ STR_6589 :Show window buttons on the left STR_6590 :Show the window buttons (e.g. to close the window) on the left of the title bar instead of on the right. STR_6591 :Staff member is currently fixing a ride and can’t be fired. STR_6592 :Staff member is currently inspecting a ride and can’t be fired. +STR_6593 :Remove park fences ############# # Scenarios # diff --git a/src/openrct2/Cheats.cpp b/src/openrct2/Cheats.cpp index 34d4914683..4e5f3a8170 100644 --- a/src/openrct2/Cheats.cpp +++ b/src/openrct2/Cheats.cpp @@ -342,6 +342,8 @@ const char* CheatsGetName(CheatType cheatType) return LanguageGetString(STR_CHEAT_ALLOW_PATH_AS_QUEUE); case CheatType::AllowSpecialColourSchemes: return LanguageGetString(STR_CHEAT_ALLOW_SPECIAL_COLOUR_SCHEMES); + case CheatType::RemoveParkFences: + return LanguageGetString(STR_CHEAT_REMOVE_PARK_FENCES); default: return "Unknown Cheat"; } diff --git a/src/openrct2/Cheats.h b/src/openrct2/Cheats.h index ff6a3a599e..d494fad636 100644 --- a/src/openrct2/Cheats.h +++ b/src/openrct2/Cheats.h @@ -91,6 +91,7 @@ enum class CheatType : int32_t NoCapOnQueueLengthDummy, // Removed; this dummy exists only for deserialisation parks that had it saved AllowRegularPathAsQueue, AllowSpecialColourSchemes, + RemoveParkFences, Count, }; diff --git a/src/openrct2/actions/CheatSetAction.cpp b/src/openrct2/actions/CheatSetAction.cpp index 371b4dff4f..54a11ea055 100644 --- a/src/openrct2/actions/CheatSetAction.cpp +++ b/src/openrct2/actions/CheatSetAction.cpp @@ -248,6 +248,9 @@ GameActions::Result CheatSetAction::Execute() const case CheatType::AllowSpecialColourSchemes: gCheatsAllowSpecialColourSchemes = static_cast(_param1); break; + case CheatType::RemoveParkFences: + RemoveParkFences(); + break; default: { LOG_ERROR("Unabled cheat: %d", _cheatType.id); @@ -395,6 +398,8 @@ ParametersRange CheatSetAction::GetParameterRange(CheatType cheatType) const case CheatType::NoCapOnQueueLengthDummy: [[fallthrough]]; case CheatType::RemoveLitter: + [[fallthrough]]; + case CheatType::RemoveParkFences: return { { 0, 0 }, { 0, 0 } }; case CheatType::Count: break; @@ -786,3 +791,19 @@ void CheatSetAction::CreateDucks(int count) const } } } + +void CheatSetAction::RemoveParkFences() const +{ + TileElementIterator it; + TileElementIteratorBegin(&it); + do + { + if (it.element->GetType() == TileElementType::Surface) + { + // Remove all park fence flags + it.element->AsSurface()->SetParkFences(0); + } + } while (TileElementIteratorNext(&it)); + + GfxInvalidateScreen(); +} diff --git a/src/openrct2/actions/CheatSetAction.h b/src/openrct2/actions/CheatSetAction.h index fb94cbdaab..90cc51916c 100644 --- a/src/openrct2/actions/CheatSetAction.h +++ b/src/openrct2/actions/CheatSetAction.h @@ -54,4 +54,5 @@ private: void OwnAllLand() const; void ParkSetOpen(bool isOpen) const; void CreateDucks(int count) const; + void RemoveParkFences() const; }; diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index 2be242fa70..b61ab6f5b9 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -1396,18 +1396,8 @@ static int32_t ConsoleCommandRemoveFloatingObjects(InteractiveConsole& console, static int32_t ConsoleCommandRemoveParkFences(InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv) { - TileElementIterator it; - TileElementIteratorBegin(&it); - do - { - if (it.element->GetType() == TileElementType::Surface) - { - // Remove all park fence flags - it.element->AsSurface()->SetParkFences(0); - } - } while (TileElementIteratorNext(&it)); - - GfxInvalidateScreen(); + auto action = CheatSetAction(CheatType::RemoveParkFences); + GameActions::Execute(&action); console.WriteFormatLine("Park fences have been removed."); return 0; diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index 22c03f3711..906598b8b4 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -4000,6 +4000,8 @@ enum : uint16_t STR_CANT_FIRE_STAFF_FIXING = 6591, STR_CANT_FIRE_STAFF_INSPECTING = 6592, + STR_CHEAT_REMOVE_PARK_FENCES = 6593, + // Have to include resource strings (from scenarios and objects) for the time being now that language is partially working /* MAX_STR_COUNT = 32768 */ // MAX_STR_COUNT - upper limit for number of strings, not the current count strings }; diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 743c73977f..2567717efe 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -43,7 +43,7 @@ // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "7" +#define NETWORK_STREAM_VERSION "8" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION