Update to 12.0-RC1

This commit is contained in:
dP
2021-09-26 20:30:12 +03:00
parent c9765f712f
commit 4eb8b29dbf
173 changed files with 31125 additions and 9485 deletions

View File

@@ -1809,6 +1809,14 @@ static void AdvanceWagonsAfterSwap(Train *v)
}
}
static bool IsWholeTrainInsideDepot(const Train *v)
{
for (const Train *u = v; u != nullptr; u = u->Next()) {
if (u->track != TRACK_BIT_DEPOT || u->tile != v->tile) return false;
}
return true;
}
/**
* Turn a train around.
* @param v %Train to turn around.
@@ -1816,6 +1824,7 @@ static void AdvanceWagonsAfterSwap(Train *v)
void ReverseTrainDirection(Train *v)
{
if (IsRailDepotTile(v->tile)) {
if (IsWholeTrainInsideDepot(v)) return;
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
}