diff options
author | rubidium <rubidium@openttd.org> | 2009-05-22 22:33:05 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-05-22 22:33:05 +0000 |
commit | c4b627af422075ce4a0e1026c52f871dd3f146c0 (patch) | |
tree | febaea249dc307b4b619aeff09e353677bbbcd84 /src/rail_cmd.cpp | |
parent | 80e94b9bb15f846189e98f1f457afe2b96ba2b58 (diff) | |
download | openttd-c4b627af422075ce4a0e1026c52f871dd3f146c0.tar.xz |
(svn r16392) -Codechange: move some variables (the ones that aren't caches) from VehicleRail to Train
Diffstat (limited to 'src/rail_cmd.cpp')
-rw-r--r-- | src/rail_cmd.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 6e9ecc37e..eb838ca26 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -93,7 +93,7 @@ Vehicle *EnsureNoTrainOnTrackProc(Vehicle *v, void *data) if (v->type != VEH_TRAIN) return NULL; Train *t = (Train *)v; - if ((t->u.rail.track != rail_bits) && !TracksOverlap(t->u.rail.track | rail_bits)) return NULL; + if ((t->track != rail_bits) && !TracksOverlap(t->track | rail_bits)) return NULL; _error_message = VehicleInTheWayErrMsg(v); return v; @@ -1308,7 +1308,7 @@ CommandCost CmdConvertRail(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 Track track; while ((track = RemoveFirstTrack(&reserved)) != INVALID_TRACK) { Train *v = GetTrainForReservation(tile, track); - if (v != NULL && !HasPowerOnRail(v->u.rail.railtype, totype)) { + if (v != NULL && !HasPowerOnRail(v->railtype, totype)) { /* No power on new rail type, reroute. */ FreeTrainTrackReservation(v); *vehicles_affected.Append() = v; @@ -1374,7 +1374,7 @@ CommandCost CmdConvertRail(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 Track track = DiagDirToDiagTrack(GetTunnelBridgeDirection(tile)); if (GetTunnelBridgeReservation(tile)) { Train *v = GetTrainForReservation(tile, track); - if (v != NULL && !HasPowerOnRail(v->u.rail.railtype, totype)) { + if (v != NULL && !HasPowerOnRail(v->railtype, totype)) { /* No power on new rail type, reroute. */ FreeTrainTrackReservation(v); *vehicles_affected.Append() = v; @@ -2484,7 +2484,7 @@ static VehicleEnterTileStatus VehicleEnter_Track(Vehicle *u, TileIndex tile, int } else if (_fractcoords_enter[dir] == fract_coord) { if (DiagDirToDir(ReverseDiagDir(dir)) == v->direction) { /* enter the depot */ - v->u.rail.track = TRACK_BIT_DEPOT, + v->track = TRACK_BIT_DEPOT, v->vehstatus |= VS_HIDDEN; // hide it v->direction = ReverseDir(v->direction); if (v->Next() == NULL) VehicleEnterDepot(v); @@ -2498,7 +2498,7 @@ static VehicleEnterTileStatus VehicleEnter_Track(Vehicle *u, TileIndex tile, int /* leave the depot? */ if ((v = v->Next()) != NULL) { v->vehstatus &= ~VS_HIDDEN; - v->u.rail.track = (DiagDirToAxis(dir) == AXIS_X ? TRACK_BIT_X : TRACK_BIT_Y); + v->track = (DiagDirToAxis(dir) == AXIS_X ? TRACK_BIT_X : TRACK_BIT_Y); } } } |