(svn r16392) -Codechange: move some variables (the ones that aren't caches) from VehicleRail to Train

This commit is contained in:
rubidium
2009-05-22 22:33:05 +00:00
parent 80e94b9bb1
commit c4b627af42
24 changed files with 265 additions and 263 deletions

View File

@@ -349,7 +349,7 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
if (!CheckOwnership(v->owner)) return CMD_ERROR;
if (v->type == VEH_TRAIN && (!IsFrontEngine(v) || v->u.rail.crash_anim_pos >= 4400)) return CMD_ERROR;
if (v->type == VEH_TRAIN && (!IsFrontEngine(v) || ((Train *)v)->crash_anim_pos >= 4400)) return CMD_ERROR;
/* check that we can allocate enough vehicles */
if (!(flags & DC_EXEC)) {
@@ -381,8 +381,8 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
if (flags & DC_EXEC) {
w = Vehicle::Get(_new_vehicle_id);
if (v->type == VEH_TRAIN && HasBit(((Train *)v)->u.rail.flags, VRF_REVERSE_DIRECTION)) {
SetBit(((Train *)w)->u.rail.flags, VRF_REVERSE_DIRECTION);
if (v->type == VEH_TRAIN && HasBit(((Train *)v)->flags, VRF_REVERSE_DIRECTION)) {
SetBit(((Train *)w)->flags, VRF_REVERSE_DIRECTION);
}
if (v->type == VEH_TRAIN && !IsFrontEngine(v)) {