mirror of https://github.com/OpenRCT2/OpenRCT2.git
Provide a game command translation
This commit is contained in:
parent
3162d4dc75
commit
afca838f17
|
@ -19,6 +19,7 @@
|
||||||
#include "actions/RideEntranceExitPlaceAction.hpp"
|
#include "actions/RideEntranceExitPlaceAction.hpp"
|
||||||
#include "actions/RideSetSetting.hpp"
|
#include "actions/RideSetSetting.hpp"
|
||||||
#include "actions/SetCheatAction.hpp"
|
#include "actions/SetCheatAction.hpp"
|
||||||
|
#include "actions/TileModifyAction.hpp"
|
||||||
#include "actions/TrackPlaceAction.hpp"
|
#include "actions/TrackPlaceAction.hpp"
|
||||||
#include "config/Config.h"
|
#include "config/Config.h"
|
||||||
#include "core/DataSerialiser.h"
|
#include "core/DataSerialiser.h"
|
||||||
|
@ -537,6 +538,27 @@ namespace OpenRCT2
|
||||||
result.action->SetFlags(command.ebx & 0xFF);
|
result.action->SetFlags(command.ebx & 0xFF);
|
||||||
break;
|
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<TileModifyType>(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<TileModifyAction>(loc, type, 0, 0, copiedElement);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result.action = std::make_unique<TileModifyAction>(loc, type, param1, param2);
|
||||||
|
}
|
||||||
|
result.action->SetFlags(command.ebx & 0xFF);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
throw std::runtime_error("Deprecated game command requires replay translation.");
|
throw std::runtime_error("Deprecated game command requires replay translation.");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue