diff --git a/src/openrct2/ReplayManager.cpp b/src/openrct2/ReplayManager.cpp index 157be538b0..ad5cde11ae 100644 --- a/src/openrct2/ReplayManager.cpp +++ b/src/openrct2/ReplayManager.cpp @@ -19,6 +19,7 @@ #include "actions/RideEntranceExitPlaceAction.hpp" #include "actions/RideSetSetting.hpp" #include "actions/SetCheatAction.hpp" +#include "actions/TileModifyAction.hpp" #include "actions/TrackPlaceAction.hpp" #include "config/Config.h" #include "core/DataSerialiser.h" @@ -537,6 +538,27 @@ namespace OpenRCT2 result.action->SetFlags(command.ebx & 0xFF); break; } + case GAME_COMMAND_MODIFY_TILE: + { + int32_t param1 = command.edx; + int32_t param2 = command.edi; + CoordsXY loc = { (command.ecx & 0xFF) * 32, ((command.ecx >> 8) & 0xFF) * 32 }; + TileModifyType type = static_cast(command.eax & 0xFF); + + if (type == TileModifyType::AnyPaste) + { + TileElement copiedElement{}; + int32_t data[2] = { command.edx, command.edi }; + std::memcpy(&copiedElement, &data[0], 8); + result.action = std::make_unique(loc, type, 0, 0, copiedElement); + } + else + { + result.action = std::make_unique(loc, type, param1, param2); + } + result.action->SetFlags(command.ebx & 0xFF); + break; + } default: throw std::runtime_error("Deprecated game command requires replay translation."); }