Skip to content

Commit

Permalink
Fix OpenRCT2#9902: Doors and portcullises can be double opened
Browse files Browse the repository at this point in the history
  • Loading branch information
Spongeloaf authored and Evan Haataja committed Apr 27, 2020
1 parent 24e7c3a commit 6286cce
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/openrct2/ride/Vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 6286cce

Please sign in to comment.