diff src/command.cpp @ 12485:cf4a59021c9d draft

(svn r16922) -Codechange: unduplicate some vehicle CMD_*s and move the setting of the error message to a single place
author rubidium <rubidium@openttd.org>
date Wed, 22 Jul 2009 23:39:35 +0000
parents cbc3f4302215
children 92b34b5e5b00
line wrap: on
line diff
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -402,7 +402,8 @@
 	/* 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;