diff options
author | rubidium <rubidium@openttd.org> | 2009-07-22 23:39:35 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-07-22 23:39:35 +0000 |
commit | b04ba7dcea92039c2e04f6ce9280fa3d488ebc3f (patch) | |
tree | 5d956d8a7d930305f4630976732c0985cad07323 /src/command.cpp | |
parent | 9980af289835021ef605f9f452d1f289145c6314 (diff) | |
download | openttd-b04ba7dcea92039c2e04f6ce9280fa3d488ebc3f.tar.xz |
(svn r16922) -Codechange: unduplicate some vehicle CMD_*s and move the setting of the error message to a single place
Diffstat (limited to 'src/command.cpp')
-rw-r--r-- | src/command.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/command.cpp b/src/command.cpp index f6f3b2e2e..4b4ba50d8 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -402,7 +402,8 @@ CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, DoCommandFlag flags, /* Do not even think about executing out-of-bounds tile-commands */ if (tile != 0 && (tile >= MapSize() || (!IsValidTile(tile) && (flags & DC_ALL_TILES) == 0))) return CMD_ERROR; - CommandProc *proc = _command_proc_table[cmd].proc; + /* Chop of any CMD_MSG or other flags; we don't need those here */ + CommandProc *proc = _command_proc_table[cmd & CMD_ID_MASK].proc; if (_docommand_recursive == 0) _error_message = INVALID_STRING_ID; |