(svn r16922) -Codechange: unduplicate some vehicle CMD_*s and move the setting of the error message to a single place

This commit is contained in:
rubidium
2009-07-22 23:39:35 +00:00
parent 9980af2898
commit b04ba7dcea
5 changed files with 30 additions and 52 deletions

View File

@@ -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;