equal
deleted
inserted
replaced
307 }; |
307 }; |
308 |
308 |
309 /* This function range-checks a cmd, and checks if the cmd is not NULL */ |
309 /* This function range-checks a cmd, and checks if the cmd is not NULL */ |
310 bool IsValidCommand(uint cmd) |
310 bool IsValidCommand(uint cmd) |
311 { |
311 { |
312 cmd = cmd & 0xFF; |
312 cmd &= 0xFF; |
313 |
313 |
314 if (cmd >= lengthof(_command_proc_table) || _command_proc_table[cmd].proc == NULL) |
314 return |
315 return false; |
315 cmd < lengthof(_command_proc_table) && |
316 |
316 _command_proc_table[cmd].proc != NULL; |
317 return true; |
|
318 } |
317 } |
319 |
318 |
320 byte GetCommandFlags(uint cmd) {return _command_proc_table[cmd & 0xFF].flags;} |
319 byte GetCommandFlags(uint cmd) {return _command_proc_table[cmd & 0xFF].flags;} |
321 |
320 |
322 int32 DoCommandByTile(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc) |
321 int32 DoCommandByTile(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc) |