station_cmd.c
changeset 4434 a08cb4b5c179
parent 4399 960cf4a06027
child 4467 156585f085d2
equal deleted inserted replaced
4433:98632ba2212a 4434:a08cb4b5c179
   797 
   797 
   798 		flat_z = z;
   798 		flat_z = z;
   799 		if (tileh != SLOPE_FLAT) {
   799 		if (tileh != SLOPE_FLAT) {
   800 			// need to check so the entrance to the station is not pointing at a slope.
   800 			// need to check so the entrance to the station is not pointing at a slope.
   801 			if ((invalid_dirs&1 && !(tileh & SLOPE_NE) && (uint)w_cur == w) ||
   801 			if ((invalid_dirs&1 && !(tileh & SLOPE_NE) && (uint)w_cur == w) ||
   802 					(invalid_dirs&2 && !(tileh & SLOPE_SE) &&	h_cur == 1) ||
   802 					(invalid_dirs&2 && !(tileh & SLOPE_SE) && h_cur == 1) ||
   803 					(invalid_dirs&4 && !(tileh & SLOPE_SW) && w_cur == 1) ||
   803 					(invalid_dirs&4 && !(tileh & SLOPE_SW) && w_cur == 1) ||
   804 					(invalid_dirs&8 && !(tileh & SLOPE_NW) && (uint)h_cur == h)) {
   804 					(invalid_dirs&8 && !(tileh & SLOPE_NW) && (uint)h_cur == h)) {
   805 				return_cmd_error(STR_0007_FLAT_LAND_REQUIRED);
   805 				return_cmd_error(STR_0007_FLAT_LAND_REQUIRED);
   806 			}
   806 			}
   807 			cost += _price.terraform;
   807 			cost += _price.terraform;
  1018 				return CMD_ERROR;
  1018 				return CMD_ERROR;
  1019 		}
  1019 		}
  1020 
  1020 
  1021 		//XXX can't we pack this in the "else" part of the if above?
  1021 		//XXX can't we pack this in the "else" part of the if above?
  1022 		if (!CheckStationSpreadOut(st, tile_org, w_org, h_org)) return CMD_ERROR;
  1022 		if (!CheckStationSpreadOut(st, tile_org, w_org, h_org)) return CMD_ERROR;
  1023 	}	else {
  1023 	} else {
  1024 		// Create a new station
  1024 		// Create a new station
  1025 		st = AllocateStation();
  1025 		st = AllocateStation();
  1026 		if (st == NULL) return CMD_ERROR;
  1026 		if (st == NULL) return CMD_ERROR;
  1027 
  1027 
  1028 		st->town = ClosestTownFromTile(tile_org, (uint)-1);
  1028 		st->town = ClosestTownFromTile(tile_org, (uint)-1);