Codechange: Store the rail type of rail engines as a RailTypes bitmask.
This commit is contained in:
@@ -1620,7 +1620,7 @@ CommandCost CmdConvertRail(DoCommandFlags flags, TileIndex tile, TileIndex area_
|
||||
Track track;
|
||||
while ((track = RemoveFirstTrack(&reserved)) != INVALID_TRACK) {
|
||||
Train *v = GetTrainForReservation(tile, track);
|
||||
if (v != nullptr && !HasPowerOnRail(v->railtype, totype)) {
|
||||
if (v != nullptr && !HasPowerOnRail(v->railtypes, totype)) {
|
||||
/* No power on new rail type, reroute. */
|
||||
FreeTrainTrackReservation(v);
|
||||
vehicles_affected.push_back(v);
|
||||
@@ -1706,7 +1706,7 @@ CommandCost CmdConvertRail(DoCommandFlags flags, TileIndex tile, TileIndex area_
|
||||
Track track = DiagDirToDiagTrack(GetTunnelBridgeDirection(tile));
|
||||
if (HasTunnelBridgeReservation(tile)) {
|
||||
Train *v = GetTrainForReservation(tile, track);
|
||||
if (v != nullptr && !HasPowerOnRail(v->railtype, totype)) {
|
||||
if (v != nullptr && !HasPowerOnRail(v->railtypes, totype)) {
|
||||
/* No power on new rail type, reroute. */
|
||||
FreeTrainTrackReservation(v);
|
||||
vehicles_affected.push_back(v);
|
||||
|
||||
Reference in New Issue
Block a user