From 315070faaa0d157698eab0619c00995fa1b42c76 Mon Sep 17 00:00:00 2001 From: spacek531 Date: Sun, 22 Aug 2021 21:44:04 -0700 Subject: [PATCH] set value to 0 --- src/openrct2/ride/Vehicle.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 9302ff8c28..1991d873e2 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -1522,16 +1522,16 @@ bool Vehicle::OpenRestraints() } if (vehicleEntry->animation == VEHICLE_ENTRY_ANIMATION_OBSERVATION_TOWER && vehicle->animation_frame != 0) { - if (vehicle->animationState + 0x3333 < 0xFFFF) + if (vehicle->animationState <= 0xCCCC) { - vehicle->animationState = vehicle->animationState + 0x3333 - 0xFFFF; - vehicle->animation_frame++; - vehicle->animation_frame &= 7; - vehicle->Invalidate(); + vehicle->animationState += 0x3333; } else { - vehicle->animationState += 0x3333; + vehicle->animationState = 0; + vehicle->animation_frame++; + vehicle->animation_frame &= 7; + vehicle->Invalidate(); } restraintsOpen = false; continue; @@ -5512,15 +5512,18 @@ void Vehicle::UpdateCrash() ExplosionCloud::Create({ curVehicle->x + xOffset, curVehicle->y + yOffset, curVehicle->z }); } } - if (curVehicle->animationState + 7281 > 0xFFFF) + if (curVehicle->animationState <= 58248) { + curVehicle->animationState += 7281; + } + else + { + curVehicle->animationState = 0; curVehicle->animation_frame++; if (curVehicle->animation_frame >= 8) curVehicle->animation_frame = 0; curVehicle->Invalidate(); } - curVehicle->animationState += 7281; - curVehicle->animationState &= 0xFFFF; continue; } @@ -7410,7 +7413,7 @@ void Vehicle::UpdateAdditionalAnimation() } else { - animationState += 0x3333; + animationState = 0; animation_frame += 1; animation_frame &= 7; Invalidate(); @@ -7447,7 +7450,7 @@ void Vehicle::UpdateAdditionalAnimation() } else { - animationState += 0x3333; + animationState = 0; if (seat_rotation >= target_seat_rotation) seat_rotation--;