1
0
Fork 0

Fix: Prevent duplicate train reversal when already reversing

pull/14320/head
ArtiomGusev 2025-06-01 12:40:00 +03:00
parent 2cd3c8db86
commit e46456d605
1 changed files with 2 additions and 0 deletions

View File

@ -1973,6 +1973,8 @@ static bool IsWholeTrainInsideDepot(const Train *v)
*/
void ReverseTrainDirection(Train *v)
{
DEBUG(driver, 1, "Reversing train %d on tile %d", v->index, v->tile);
if (IsRailDepotTile(v->tile)) {
if (IsWholeTrainInsideDepot(v)) return;
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);