From 8bd374f9ddfa7ad903cfbdbdd35079799b4f47d4 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Tue, 7 Mar 2017 19:44:14 +0000 Subject: [PATCH] Fix #5275. Door animations now play correctly. Mistake caused when refactoring. I did some copy paste coding and forgot to test it. On top of that mistakenly thought 0x30 >> 3 = 12 when it equals 6. --- src/openrct2/ride/vehicle.c | 4 ++-- src/openrct2/world/wall.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2/ride/vehicle.c b/src/openrct2/ride/vehicle.c index 7c4b44398b..29652422c4 100644 --- a/src/openrct2/ride/vehicle.c +++ b/src/openrct2/ride/vehicle.c @@ -6859,7 +6859,7 @@ static void vehicle_update_scenery_door(rct_vehicle *vehicle) vehicle_play_scenery_door_open_sound(vehicle, mapElement); } else { mapElement->properties.wall.animation &= ~(WALL_ANIMATION_FLAG_DIRECTION_BACKWARD); - wall_element_set_animation_frame(mapElement, 12); + wall_element_set_animation_frame(mapElement, 6); vehicle_play_scenery_door_close_sound(vehicle, mapElement); } } @@ -6942,7 +6942,7 @@ static void sub_6DEDE8(rct_vehicle *vehicle) vehicle_play_scenery_door_open_sound(vehicle, mapElement); } else { mapElement->properties.wall.animation &= ~(WALL_ANIMATION_FLAG_DIRECTION_BACKWARD); - wall_element_set_animation_frame(mapElement, 12); + wall_element_set_animation_frame(mapElement, 6); vehicle_play_scenery_door_close_sound(vehicle, mapElement); } } diff --git a/src/openrct2/world/wall.cpp b/src/openrct2/world/wall.cpp index 5be09508d3..97cb3d039a 100644 --- a/src/openrct2/world/wall.cpp +++ b/src/openrct2/world/wall.cpp @@ -702,7 +702,7 @@ extern "C" void wall_element_set_animation_frame(rct_map_element * wallElement, uint8 frameNum) { wallElement->properties.wall.animation &= WALL_ANIMATION_FLAG_ALL_FLAGS; - wallElement->properties.wall.animation |= (frameNum >> 3) & 0xF; + wallElement->properties.wall.animation |= (frameNum & 0xF) << 3; } uint8 wall_element_get_secondary_colour(rct_map_element * wallElement)