Change: Avoid crashing to the side of a train
When a road vehicle is already running on a multi level crossing, and a train shows up ahead, don't make the road vehicle crash on the side of the train.
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include "effectvehicle_base.h"
|
||||
#include "elrail_func.h"
|
||||
#include "roadveh.h"
|
||||
#include "train.h"
|
||||
#include "town.h"
|
||||
#include "company_base.h"
|
||||
#include "core/random_func.hpp"
|
||||
@@ -2086,6 +2087,8 @@ static TrackStatus GetTileTrackStatus_Road(TileIndex tile, TransportType mode, u
|
||||
trackdirbits = TrackBitsToTrackdirBits(AxisToTrackBits(axis));
|
||||
if (IsCrossingBarred(tile)) {
|
||||
red_signals = trackdirbits;
|
||||
if (TrainOnCrossing(tile)) break;
|
||||
|
||||
auto mask_red_signal_bits_if_crossing_barred = [&](TileIndex t, TrackdirBits mask) {
|
||||
if (IsLevelCrossingTile(t) && IsCrossingBarred(t)) red_signals &= mask;
|
||||
};
|
||||
|
Reference in New Issue
Block a user