command.c
changeset 2645 964bd8fe3ce2
parent 2425 99e1e8430a28
child 2682 94ca0b4dc53f
--- a/command.c	Tue Nov 15 09:05:16 2005 +0000
+++ b/command.c	Tue Nov 15 09:47:25 2005 +0000
@@ -309,12 +309,11 @@
 /* This function range-checks a cmd, and checks if the cmd is not NULL */
 bool IsValidCommand(uint cmd)
 {
-	cmd = cmd & 0xFF;
+	cmd &= 0xFF;
 
-	if (cmd >= lengthof(_command_proc_table) || _command_proc_table[cmd].proc == NULL)
-		return false;
-
-	return true;
+	return
+		cmd < lengthof(_command_proc_table) &&
+		_command_proc_table[cmd].proc != NULL;
 }
 
 byte GetCommandFlags(uint cmd) {return _command_proc_table[cmd & 0xFF].flags;}