station_cmd.c
changeset 534 306bc86eb23e
parent 507 04b5403aaf6b
child 536 03d80fecb999
equal deleted inserted replaced
533:404f9e37bff1 534:306bc86eb23e
   325 {
   325 {
   326 	Point pt = RemapCoords2(GET_TILE_X(st->xy) * 16, GET_TILE_Y(st->xy) * 16);
   326 	Point pt = RemapCoords2(GET_TILE_X(st->xy) * 16, GET_TILE_Y(st->xy) * 16);
   327 	pt.y -= 32;
   327 	pt.y -= 32;
   328 	if (st->facilities&FACIL_AIRPORT && st->airport_type==AT_OILRIG) pt.y -= 16;
   328 	if (st->facilities&FACIL_AIRPORT && st->airport_type==AT_OILRIG) pt.y -= 16;
   329 
   329 
   330 	SET_DPARAM16(0, st->index);
   330 	SetDParam(0, st->index);
   331 	SET_DPARAM8(1, st->facilities);
   331 	SetDParam(1, st->facilities);
   332 	UpdateViewportSignPos(&st->sign, pt.x, pt.y, STR_305C_0);
   332 	UpdateViewportSignPos(&st->sign, pt.x, pt.y, STR_305C_0);
   333 }
   333 }
   334 
   334 
   335 // Update the virtual coords needed to draw the station sign for all stations.
   335 // Update the virtual coords needed to draw the station sign for all stations.
   336 void UpdateAllStationVirtCoord()
   336 void UpdateAllStationVirtCoord()
   366 // Items contains the two cargo names that are to be accepted or rejected.
   366 // Items contains the two cargo names that are to be accepted or rejected.
   367 // msg is the string id of the message to display.
   367 // msg is the string id of the message to display.
   368 static void ShowRejectOrAcceptNews(Station *st, uint32 items, StringID msg)
   368 static void ShowRejectOrAcceptNews(Station *st, uint32 items, StringID msg)
   369 {
   369 {
   370 	if (items) {
   370 	if (items) {
   371 		SET_DPARAM32(2, items >> 16);
   371 		SetDParam(2, items >> 16);
   372 		SET_DPARAM32(1, items & 0xFFFF);
   372 		SetDParam(1, items & 0xFFFF);
   373 		SET_DPARAM16(0, st->index);
   373 		SetDParam(0, st->index);
   374 		AddNewsItem(msg + ((items >> 16)?1:0), NEWS_FLAGS(NM_SMALL, NF_VIEWPORT|NF_TILE, NT_ACCEPTANCE, 0), st->xy, 0);
   374 		AddNewsItem(msg + ((items >> 16)?1:0), NEWS_FLAGS(NM_SMALL, NF_VIEWPORT|NF_TILE, NT_ACCEPTANCE, 0), st->xy, 0);
   375 	}
   375 	}
   376 }
   376 }
   377 
   377 
   378 // Get a list of the cargo types being produced around the tile.
   378 // Get a list of the cargo types being produced around the tile.
  1515 		FOR_ALL_STATIONS(st) {
  1515 		FOR_ALL_STATIONS(st) {
  1516 			if (st->xy != 0 && st->town == t && st->facilities&FACIL_AIRPORT && st->airport_type != AT_OILRIG)
  1516 			if (st->xy != 0 && st->town == t && st->facilities&FACIL_AIRPORT && st->airport_type != AT_OILRIG)
  1517 				num++;
  1517 				num++;
  1518 		}
  1518 		}
  1519 		if (num >= 2) {
  1519 		if (num >= 2) {
  1520 			SET_DPARAM16(0, t->index);
  1520 			SetDParam(0, t->index);
  1521 			return_cmd_error(STR_2035_LOCAL_AUTHORITY_REFUSES);
  1521 			return_cmd_error(STR_2035_LOCAL_AUTHORITY_REFUSES);
  1522 		}
  1522 		}
  1523 	}
  1523 	}
  1524 
  1524 
  1525 	w = _airport_size_x[p1];
  1525 	w = _airport_size_x[p1];
  2620 		if (m5 < 0x43 || (m5 >= 83 && m5 <= 114)) return_cmd_error(STR_300E_MUST_DEMOLISH_AIRPORT_FIRST);
  2620 		if (m5 < 0x43 || (m5 >= 83 && m5 <= 114)) return_cmd_error(STR_300E_MUST_DEMOLISH_AIRPORT_FIRST);
  2621 		if (m5 < 0x47) return_cmd_error(STR_3047_MUST_DEMOLISH_TRUCK_STATION);
  2621 		if (m5 < 0x47) return_cmd_error(STR_3047_MUST_DEMOLISH_TRUCK_STATION);
  2622 		if (m5 < 0x4B) return_cmd_error(STR_3046_MUST_DEMOLISH_BUS_STATION);
  2622 		if (m5 < 0x4B) return_cmd_error(STR_3046_MUST_DEMOLISH_BUS_STATION);
  2623 		if (m5 == 0x52) return_cmd_error(STR_306A_BUOY_IN_THE_WAY);
  2623 		if (m5 == 0x52) return_cmd_error(STR_306A_BUOY_IN_THE_WAY);
  2624 		if (m5 != 0x4B && m5 < 0x53) return_cmd_error(STR_304D_MUST_DEMOLISH_DOCK_FIRST);
  2624 		if (m5 != 0x4B && m5 < 0x53) return_cmd_error(STR_304D_MUST_DEMOLISH_DOCK_FIRST);
  2625 		SET_DPARAM16(0, STR_4807_OIL_RIG);
  2625 		SetDParam(0, STR_4807_OIL_RIG);
  2626 		return_cmd_error(STR_4800_IN_THE_WAY);
  2626 		return_cmd_error(STR_4800_IN_THE_WAY);
  2627 	}
  2627 	}
  2628 
  2628 
  2629 	st = DEREF_STATION(_map2[tile]);
  2629 	st = DEREF_STATION(_map2[tile]);
  2630 
  2630