1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 22:34:33 +01:00

Make remove_park_fences multiplayer-safe

This commit is contained in:
Gymnasiast
2023-10-28 21:21:13 +02:00
parent e24b59e939
commit 6d87e3e56d
7 changed files with 30 additions and 12 deletions

View File

@@ -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;