Add train cache flag for whether train using realistic braking physics

This commit is contained in:
Jonathan G Rennison
2021-04-15 19:39:36 +01:00
parent b514d29db1
commit ba2e6087b2
8 changed files with 30 additions and 20 deletions

View File

@@ -3647,7 +3647,7 @@ static VehicleEnterTileStatus VehicleEnter_Station(Vehicle *v, TileIndex tile, i
stop &= TILE_SIZE - 1;
if (x == stop) {
if (_settings_game.vehicle.train_braking_model == TBM_REALISTIC && front->cur_speed > 15 && !(front->lookahead != nullptr && HasBit(front->lookahead->flags, TRLF_APPLY_ADVISORY))) {
if (front->UsingRealisticBraking() && front->cur_speed > 15 && !(front->lookahead != nullptr && HasBit(front->lookahead->flags, TRLF_APPLY_ADVISORY))) {
/* Travelling too fast, do not stop and report overshoot to player */
if (front->owner == _local_company) {
SetDParam(0, front->index);
@@ -3664,7 +3664,7 @@ static VehicleEnterTileStatus VehicleEnter_Station(Vehicle *v, TileIndex tile, i
}
return VETSB_ENTERED_STATION | (VehicleEnterTileStatus)(station_id << VETS_STATION_ID_OFFSET); // enter station
} else if (x < stop) {
if (_settings_game.vehicle.train_braking_model == TBM_REALISTIC && front->cur_speed > 30) {
if (front->UsingRealisticBraking()&& front->cur_speed > 30) {
/* Travelling too fast, take no action */
return VETSB_CONTINUE;
}