diff options
author | rubidium <rubidium@openttd.org> | 2010-01-18 22:57:21 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-01-18 22:57:21 +0000 |
commit | 4d93b704d9f0e6e58dac1d97f79a05bd4320c43f (patch) | |
tree | f80050fa083b86d7a7d75efd1ae49a04b358666d /src/command.cpp | |
parent | d8e126d98ddc35df0ac97bd35a076edf1cf172c8 (diff) | |
download | openttd-4d93b704d9f0e6e58dac1d97f79a05bd4320c43f.tar.xz |
(svn r18866) -Codechange: remove the CmdFailed(ret)/CmdSucceeded(ret) wrapper functions
Diffstat (limited to 'src/command.cpp')
-rw-r--r-- | src/command.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/command.cpp b/src/command.cpp index 5a81751e0..6d5484458 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -411,7 +411,7 @@ CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, DoCommandFlag flags, SetTownRatingTestMode(true); res = proc(tile, flags & ~DC_EXEC, p1, p2, text); SetTownRatingTestMode(false); - if (CmdFailed(res)) { + if (res.Failed()) { goto error; } @@ -431,7 +431,7 @@ CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, DoCommandFlag flags, /* Execute the command here. All cost-relevant functions set the expenses type * themselves to the cost object at some point */ res = proc(tile, flags, p1, p2, text); - if (CmdFailed(res)) { + if (res.Failed()) { error: res.SetGlobalErrorMessage(); _docommand_recursive--; @@ -507,7 +507,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallbac int y = TileY(tile) * TILE_SIZE; CommandCost res = DoCommandPInternal(tile, p1, p2, cmd, callback, text, my_cmd, estimate_only); - if (CmdFailed(res)) { + if (res.Failed()) { res.SetGlobalErrorMessage(); /* Only show the error when it's for us. */ @@ -530,7 +530,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallbac callback(res, tile, p1, p2); } - return CmdSucceeded(res); + return res.Succeeded(); } @@ -621,7 +621,7 @@ CommandCost DoCommandPInternal(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, * (unless it's a command where the test and * execution phase might return different costs) * we bail out here. */ - if (CmdFailed(res) || estimate_only || + if (res.Failed() || estimate_only || (!test_and_exec_can_differ && !CheckCompanyHasMoney(res))) { return_dcpi(res, false); } @@ -656,8 +656,8 @@ CommandCost DoCommandPInternal(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, * check whether the test and execution have yielded the same * result, i.e. cost and error state are the same. */ if (!test_and_exec_can_differ && !skip_test) { - assert(res.GetCost() == res2.GetCost() && CmdFailed(res) == CmdFailed(res2)); // sanity check - } else if (CmdFailed(res2)) { + assert(res.GetCost() == res2.GetCost() && res.Failed() == res2.Failed()); // sanity check + } else if (res2.Failed()) { return_dcpi(res2, false); } |