From 8d26d032e115af22866b0b023ad3bc203eae55ae Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Fri, 17 May 2024 20:50:04 +0100 Subject: [PATCH] Fix #12497: [NewGRF] Increase vehicle motion counter for all parts. (#12561) NewGRFs relied on the incorrectly motion counter that was 'fixed' in #12229, so always update v->motion_counter for all vehicle parts. --- src/vehicle.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 2e1b82b172d76..d0a16880f6c76 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1033,6 +1033,9 @@ void CallVehicleTicks() /* Do not play any sound when stopped */ if ((front->vehstatus & VS_STOPPED) && (front->type != VEH_TRAIN || front->cur_speed == 0)) continue; + /* Update motion counter for animation purposes. */ + v->motion_counter += front->cur_speed; + /* Check vehicle type specifics */ switch (v->type) { case VEH_TRAIN: @@ -1051,7 +1054,6 @@ void CallVehicleTicks() break; } - v->motion_counter += front->cur_speed; /* Play a running sound if the motion counter passes 256 (Do we not skip sounds?) */ if (GB(v->motion_counter, 0, 8) < front->cur_speed) PlayVehicleSound(v, VSE_RUNNING);