From 6286cce4fcafdf7981597048205fbbe70fe1e917 Mon Sep 17 00:00:00 2001 From: Peter <46459699+Spongeloaf@users.noreply.github.com> Date: Wed, 18 Sep 2019 17:26:33 -0400 Subject: [PATCH] Fix #9902: Doors and portcullises can be double opened --- src/openrct2/ride/Vehicle.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index b91afac95727..26c85c421917 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -7460,14 +7460,15 @@ static void vehicle_update_scenery_door(rct_vehicle* vehicle) return; } - if (vehicle->next_vehicle_on_train != SPRITE_INDEX_NULL) + if ((vehicle->next_vehicle_on_train != SPRITE_INDEX_NULL) && (tileElement->GetAnimationFrame() == 0)) { tileElement->SetAnimationIsBackwards(false); tileElement->SetAnimationFrame(1); map_animation_create(MAP_ANIMATION_TYPE_WALL_DOOR, x, y, z); vehicle_play_scenery_door_open_sound(vehicle, tileElement); } - else + + if (vehicle->next_vehicle_on_train == SPRITE_INDEX_NULL) { tileElement->SetAnimationIsBackwards(false); tileElement->SetAnimationFrame(6); @@ -7540,14 +7541,15 @@ static void vehicle_update_handle_scenery_door(rct_vehicle* vehicle) return; } - if (vehicle->next_vehicle_on_train != SPRITE_INDEX_NULL) + if ((vehicle->next_vehicle_on_train != SPRITE_INDEX_NULL) && (tileElement->GetAnimationFrame() == 0)) { tileElement->SetAnimationIsBackwards(true); tileElement->SetAnimationFrame(1); map_animation_create(MAP_ANIMATION_TYPE_WALL_DOOR, x, y, z); vehicle_play_scenery_door_open_sound(vehicle, tileElement); } - else + + if (vehicle->next_vehicle_on_train == SPRITE_INDEX_NULL) { tileElement->SetAnimationIsBackwards(true); tileElement->SetAnimationFrame(6);