mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-07-03 18:41:20 +01:00
Fix: Prevent duplicate train reversal when already reversing
This commit is contained in:
parent
e46456d605
commit
4c7ea26238
@ -1973,7 +1973,7 @@ static bool IsWholeTrainInsideDepot(const Train *v)
|
||||
*/
|
||||
void ReverseTrainDirection(Train *v)
|
||||
{
|
||||
DEBUG(driver, 1, "Reversing train %d on tile %d", v->index, v->tile);
|
||||
//DEBUG(driver, 1, "Reversing train %d on tile %d", v->index, v->tile);
|
||||
|
||||
if (IsRailDepotTile(v->tile)) {
|
||||
if (IsWholeTrainInsideDepot(v)) return;
|
||||
@ -3868,6 +3868,9 @@ static TileIndex TrainApproachingCrossingTile(const Train *v)
|
||||
*/
|
||||
static bool TrainCheckIfLineEnds(Train *v, bool reverse)
|
||||
{
|
||||
|
||||
if (v->flags.Test(VehicleRailFlag::Reversing)) return false;
|
||||
|
||||
/* First, handle broken down train */
|
||||
|
||||
int t = v->breakdown_ctr;
|
||||
@ -3917,6 +3920,7 @@ static bool TrainCheckIfLineEnds(Train *v, bool reverse)
|
||||
}
|
||||
|
||||
|
||||
|
||||
static bool TrainLocoHandler(Train *v, bool mode)
|
||||
{
|
||||
/* train has crashed? */
|
||||
|
Loading…
Reference in New Issue
Block a user