* Checks if a train is approaching a rail-road crossing * @param v vehicle on tile * @param tile tile with crossing we are testing * @return true if v is approaching a crossing */
| 1713 | * @return true if v is approaching a crossing |
| 1714 | */ |
| 1715 | static bool TrainApproachingCrossingEnum(const Vehicle *v, TileIndex tile) |
| 1716 | { |
| 1717 | if (v->type != VEH_TRAIN || v->vehstatus.Test(VehState::Crashed)) return false; |
| 1718 | |
| 1719 | const Train *t = Train::From(v); |
| 1720 | if (!t->IsFrontEngine()) return false; |
| 1721 | |
| 1722 | return TrainApproachingCrossingTile(t) == tile; |
| 1723 | } |
| 1724 | |
| 1725 | |
| 1726 | /** |
no test coverage detected