1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 21:43:06 +01:00

Only modify gLastEntranceStyle for the callee of the game action

This commit is contained in:
ζeh Matt
2022-01-29 16:42:27 +02:00
parent 657f13fec0
commit 383412252c
2 changed files with 5 additions and 1 deletions

View File

@@ -4496,6 +4496,11 @@ static void WindowRideColourDropdown(rct_window* w, rct_widgetindex widgetIndex,
{
auto rideSetAppearanceAction = RideSetAppearanceAction(
rideId, RideSetAppearanceType::EntranceStyle, ddIndex, 0);
rideSetAppearanceAction.SetCallback([ddIndex](const GameAction*, const GameActions::Result* res) {
if (res->Error != GameActions::Status::Ok)
return;
gLastEntranceStyle = ddIndex;
});
GameActions::Execute(&rideSetAppearanceAction);
break;
}

View File

@@ -135,7 +135,6 @@ GameActions::Result RideSetAppearanceAction::Execute() const
break;
case RideSetAppearanceType::EntranceStyle:
ride->entrance_style = _value;
gLastEntranceStyle = _value;
gfx_invalidate_screen();
break;
}