src/command.cpp
branchnoai
changeset 9800 ab08ca2a2018
parent 9732 f8eb3e208514
child 9826 9707ad4c9b60
equal deleted inserted replaced
9799:4f217587c047 9800:ab08ca2a2018
   397 {
   397 {
   398 	CommandCost res;
   398 	CommandCost res;
   399 	CommandProc *proc;
   399 	CommandProc *proc;
   400 
   400 
   401 	/* Do not even think about executing out-of-bounds tile-commands */
   401 	/* Do not even think about executing out-of-bounds tile-commands */
   402 	if (tile >= MapSize() || IsTileType(tile, MP_VOID)) {
   402 	if (!IsValidTile(tile)) {
   403 		_cmd_text = NULL;
   403 		_cmd_text = NULL;
   404 		return CMD_ERROR;
   404 		return CMD_ERROR;
   405 	}
   405 	}
   406 
   406 
   407 	proc = _command_proc_table[procc].proc;
   407 	proc = _command_proc_table[procc].proc;
   497 
   497 
   498 	int x = TileX(tile) * TILE_SIZE;
   498 	int x = TileX(tile) * TILE_SIZE;
   499 	int y = TileY(tile) * TILE_SIZE;
   499 	int y = TileY(tile) * TILE_SIZE;
   500 
   500 
   501 	/* Do not even think about executing out-of-bounds tile-commands */
   501 	/* Do not even think about executing out-of-bounds tile-commands */
   502 	if (tile >= MapSize() || IsTileType(tile, MP_VOID)) {
   502 	if (!IsValidTile(tile)) {
   503 		_cmd_text = NULL;
   503 		_cmd_text = NULL;
   504 		return false;
   504 		return false;
   505 	}
   505 	}
   506 
   506 
   507 	assert(_docommand_recursive == 0);
   507 	assert(_docommand_recursive == 0);