1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 19:13:07 +01:00

Refactor RideCreateAction result data passing

This commit is contained in:
ζeh Matt
2021-10-02 00:19:39 +03:00
parent 317e562845
commit 2597c04eb4
6 changed files with 23 additions and 45 deletions

View File

@@ -884,10 +884,10 @@ DukValue ScriptEngine::GameActionResultToDuk(const GameAction& action, const std
if (action.GetType() == GameCommand::CreateRide)
{
auto& rideCreateResult = static_cast<RideCreateGameActionResult&>(*result.get());
if (rideCreateResult.rideIndex != RIDE_ID_NULL)
if (result->Error == GameActions::Status::Ok)
{
obj.Set("ride", EnumValue(rideCreateResult.rideIndex));
const auto rideIndex = result->GetData<ride_id_t>();
obj.Set("ride", EnumValue(rideIndex));
}
}
else if (action.GetType() == GameCommand::HireNewStaffMember)