diff options
author | frosch <frosch@openttd.org> | 2009-06-01 15:01:54 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2009-06-01 15:01:54 +0000 |
commit | 0d782b0f96f01e7d9ac02120b8e5ca84fe9bc9f2 (patch) | |
tree | 9247ff8c6b63c62820520758d14a26b3a47f973e /src/train_cmd.cpp | |
parent | da57fe63f348a1f4628b9f17df171f4c54f0d2e7 (diff) | |
download | openttd-0d782b0f96f01e7d9ac02120b8e5ca84fe9bc9f2.tar.xz |
(svn r16498) -Codechange: Remove hardly used HASBITS.
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r-- | src/train_cmd.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 6ad8707c6..7a377098c 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -678,7 +678,7 @@ static CommandCost CmdBuildRailWagon(EngineID engine, TileIndex tile, DoCommandF /* do not connect new wagon with crashed/flooded consists */ if (w->tile == tile && IsFreeWagon(w) && w->engine_type == engine && - !HASBITS(w->vehstatus, VS_CRASHED)) { + !(w->vehstatus & VS_CRASHED)) { u = GetLastVehicleInChain(w); break; } @@ -995,7 +995,7 @@ static Train *FindGoodVehiclePos(const Train *src) Train *dst; FOR_ALL_TRAINS(dst) { - if (IsFreeWagon(dst) && dst->tile == tile && !HASBITS(dst->vehstatus, VS_CRASHED)) { + if (IsFreeWagon(dst) && dst->tile == tile && !(dst->vehstatus & VS_CRASHED)) { /* check so all vehicles in the line have the same engine. */ Train *t = dst; while (t->engine_type == eng) { @@ -1065,7 +1065,7 @@ CommandCost CmdMoveRailVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, u if (src == NULL || !CheckOwnership(src->owner)) return CMD_ERROR; /* Do not allow moving crashed vehicles inside the depot, it is likely to cause asserts later */ - if (HASBITS(src->vehstatus, VS_CRASHED)) return CMD_ERROR; + if (src->vehstatus & VS_CRASHED) return CMD_ERROR; /* if nothing is selected as destination, try and find a matching vehicle to drag to. */ Train *dst; @@ -1076,7 +1076,7 @@ CommandCost CmdMoveRailVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, u if (dst == NULL || !CheckOwnership(dst->owner)) return CMD_ERROR; /* Do not allow appending to crashed vehicles, too */ - if (HASBITS(dst->vehstatus, VS_CRASHED)) return CMD_ERROR; + if (dst->vehstatus & VS_CRASHED) return CMD_ERROR; } /* if an articulated part is being handled, deal with its parent vehicle */ @@ -1416,7 +1416,7 @@ CommandCost CmdSellRailWagon(TileIndex tile, DoCommandFlag flags, uint32 p1, uin if (v == NULL || !CheckOwnership(v->owner)) return CMD_ERROR; if (p2 > 1) return CMD_ERROR; - if (HASBITS(v->vehstatus, VS_CRASHED)) return_cmd_error(STR_CAN_T_SELL_DESTROYED_VEHICLE); + if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_CAN_T_SELL_DESTROYED_VEHICLE); while (IsArticulatedPart(v)) v = v->Previous(); Train *first = v->First(); @@ -3574,7 +3574,7 @@ static Vehicle *FindTrainCollideEnum(Vehicle *v, void *data) * As there might be more than two trains involved, we have to do that for all vehicles */ const Train *u; FOR_ALL_TRAINS(u) { - if (HASBITS(u->vehstatus, VS_CRASHED) && (u->track & TRACK_BIT_DEPOT) == TRACK_BIT_NONE) { + if ((u->vehstatus & VS_CRASHED) && (u->track & TRACK_BIT_DEPOT) == TRACK_BIT_NONE) { TrackBits trackbits = u->track; if ((trackbits & TRACK_BIT_WORMHOLE) == TRACK_BIT_WORMHOLE) { /* Vehicle is inside a wormhole, v->track contains no useful value then. */ @@ -4457,7 +4457,7 @@ bool Train::Tick() assert(IsFrontEngine(this)); return TrainLocoHandler(this, true); - } else if (IsFreeWagon(this) && HASBITS(this->vehstatus, VS_CRASHED)) { + } else if (IsFreeWagon(this) && (this->vehstatus & VS_CRASHED)) { /* Delete flooded standalone wagon chain */ if (++this->crash_anim_pos >= 4400) { delete this; |