mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-09-02 19:39:12 +00:00
Fix: Prevent duplicate train reversal when already reversing
This commit is contained in:
@@ -1973,6 +1973,8 @@ static bool IsWholeTrainInsideDepot(const Train *v)
|
|||||||
*/
|
*/
|
||||||
void ReverseTrainDirection(Train *v)
|
void ReverseTrainDirection(Train *v)
|
||||||
{
|
{
|
||||||
|
DEBUG(driver, 1, "Reversing train %d on tile %d", v->index, v->tile);
|
||||||
|
|
||||||
if (IsRailDepotTile(v->tile)) {
|
if (IsRailDepotTile(v->tile)) {
|
||||||
if (IsWholeTrainInsideDepot(v)) return;
|
if (IsWholeTrainInsideDepot(v)) return;
|
||||||
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
|
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
|
||||||
|
Reference in New Issue
Block a user