From 9c552d16317a7fe1ff4516c5021ebd0e7c82b906 Mon Sep 17 00:00:00 2001 From: Darkvater Date: Mon, 30 May 2005 14:45:36 +0000 Subject: (svn r2383) - Fix: Monkey-testing turned up some command crashes. --- command.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'command.c') diff --git a/command.c b/command.c index 29ab994fc..7c198ec36 100644 --- a/command.c +++ b/command.c @@ -428,6 +428,10 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, // get pointer to command handler assert((cmd & 0xFF) < lengthof(_command_proc_table)); proc = _command_proc_table[cmd & 0xFF].proc; + if (proc == NULL) { + _cmd_text = NULL; + return false; + } // Some commands have a different output in dryrun than the realrun // e.g.: if you demolish a whole town, the dryrun would say okay. -- cgit v1.2.3-54-g00ecf