summaryrefslogtreecommitdiff
path: root/src/command.h
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
commitb09431478d416ceb58f9676d67c1cc3b4af397bc (patch)
treea267e10793edc2f19da1d23e3a7f536644234f0f /src/command.h
parentfad2a36b8f9ce57610532226b2f14cbadc40fae9 (diff)
downloadopenttd-b09431478d416ceb58f9676d67c1cc3b4af397bc.tar.xz
(svn r10200) -Codechange: add "shortcut" for !CmdFailed (CmdSucceeded).
Diffstat (limited to 'src/command.h')
-rw-r--r--src/command.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/command.h b/src/command.h
index 428dd32d6..177663e0b 100644
--- a/src/command.h
+++ b/src/command.h
@@ -205,6 +205,8 @@ static inline bool CmdFailed(CommandCost res)
return res <= (CMD_ERROR | INVALID_STRING_ID);
}
+static inline bool CmdSucceeded(CommandCost res) { return !CmdFailed(res); }
+
/* command.cpp */
typedef void CommandCallback(bool success, TileIndex tile, uint32 p1, uint32 p2);
CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc);