From ebe0a42be7891edc797e262c49ac42286d404f3e Mon Sep 17 00:00:00 2001 From: jerrrrycho Date: Tue, 17 Nov 2026 09:17:19 +0100 Subject: [PATCH] fix(camera): the trackside view sets the train's way again when the vehicle picked changes pick() kept m_lastposition of the vehicle before, so the next motion_of() took the step between the two vehicles for a move: the direction could point back along the train, the ends swapped and the railfan went to a spot 80+ m behind the tail. Now a change of the vehicle sets m_moved to false, and the way is set again from the way the user drives. --- application/consistviews.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/application/consistviews.cpp b/application/consistviews.cpp index 15762d437..49815f6e8 100644 --- a/application/consistviews.cpp +++ b/application/consistviews.cpp @@ -132,6 +132,11 @@ TDynamicObject *consist_views::pick(std::vector const &Train, index = cameraviews::step_index(index, static_cast(Train.size()), m_step); m_step = 0; } + if (Train[index] != m_vehicle) { + // m_lastposition is of the vehicle before: the way the train goes is set again from the way the user drives, + // or the step between the two vehicles would be taken for a move + m_moved = false; + } m_vehicle = Train[index]; return m_vehicle; }