Refactor RideCreateAction result data passing

This commit is contained in:
ζeh Matt committed 2021-10-02 00:50:03 +03:00
1 parent 317e562845
commit 2597c04eb4
6 files changed
+23 -45

No files matched your search

+3 -3
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)