summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-18 16:42:40 +0000
committerrubidium <rubidium@openttd.org>2007-06-18 16:42:40 +0000
commit82e79b847e6c0c19010f0bf8f7bc462cdcd9ebc3 (patch)
treea267e10793edc2f19da1d23e3a7f536644234f0f /src/vehicle.cpp
parent80d71953ba2bbf49157ec1208589e295bb900def (diff)
downloadopenttd-82e79b847e6c0c19010f0bf8f7bc462cdcd9ebc3.tar.xz
(svn r10200) -Codechange: add "shortcut" for !CmdFailed (CmdSucceeded).
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index c6515fe19..e1bc27d7a 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -1725,7 +1725,7 @@ CommandCost CmdMassStartStopVehicle(TileIndex tile, uint32 flags, uint32 p1, uin
ret = DoCommand(tile, v->index, 0, flags, stop_command);
- if (!CmdFailed(ret)) {
+ if (CmdSucceeded(ret)) {
return_value = 0;
/* We know that the command is valid for at least one vehicle.
* If we haven't set DC_EXEC, then there is no point in continueing because it will be valid */
@@ -1781,7 +1781,7 @@ CommandCost CmdDepotSellAllVehicles(TileIndex tile, uint32 flags, uint32 p1, uin
ret = DoCommand(tile, v->index, 1, flags, sell_command);
- if (!CmdFailed(ret)) cost += ret;
+ if (CmdSucceeded(ret)) cost += ret;
}
free(engines);
@@ -1829,7 +1829,7 @@ CommandCost CmdDepotMassAutoReplace(TileIndex tile, uint32 flags, uint32 p1, uin
}
ret = MaybeReplaceVehicle(v, !(flags & DC_EXEC), false);
- if (!CmdFailed(ret)) {
+ if (CmdSucceeded(ret)) {
cost += ret;
if (!(flags & DC_EXEC)) break;
/* There is a problem with autoreplace and newgrf
@@ -1972,7 +1972,7 @@ CommandCost CmdCloneVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (w->cargo_type != v->cargo_type || w->cargo_subtype != v->cargo_type) {
cost = DoCommand(0, w->index, v->cargo_type | (v->cargo_subtype << 8) | 1U << 16 , flags, GetCmdRefitVeh(v));
- if (!CmdFailed(cost)) total_cost += cost;
+ if (CmdSucceeded(cost)) total_cost += cost;
}
if (w->type == VEH_TRAIN && EngineHasArticPart(w)) {
@@ -2240,7 +2240,7 @@ CommandCost SendAllVehiclesToDepot(VehicleType type, uint32 flags, bool service,
* In this case we know that at least one vehicle can be sent to a depot
* and we will issue the command. We can now safely quit the loop, knowing
* it will succeed at least once. With DC_EXEC we really need to send them to the depot */
- if (!CmdFailed(ret) && !(flags & DC_EXEC)) {
+ if (CmdSucceeded(ret) && !(flags & DC_EXEC)) {
free((void*)sort_list);
return 0;
}