Changeset - r28734:0920b6987490
[Not reviewed]
master
0 2 0
Joan Josep - 10 months ago 2024-02-11 17:47:49
juanjo.ng.83@gmail.com
Fix: Redraw orders when a station feature is added/removed. (#12061)
2 files changed with 5 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/station.cpp
Show inline comments
 
@@ -230,12 +230,13 @@ void Station::AddFacility(StationFacilit
 
		this->MoveSign(facil_xy);
 
		this->random_bits = Random();
 
	}
 
	this->facilities |= new_facility_bit;
 
	this->owner = _current_company;
 
	this->build_date = TimerGameCalendar::date;
 
	SetWindowClassesDirty(WC_VEHICLE_ORDERS);
 
}
 

	
 
/**
 
 * Marks the tiles of the station as dirty.
 
 *
 
 * @ingroup dirty
src/station_cmd.cpp
Show inline comments
 
@@ -1692,12 +1692,13 @@ CommandCost RemoveFromRailBaseStation(Ti
 
		MakeRailStationAreaSmaller(st);
 
		UpdateStationSignCoord(st);
 

	
 
		/* if we deleted the whole station, delete the train facility. */
 
		if (st->train_station.tile == INVALID_TILE) {
 
			st->facilities &= ~FACIL_TRAIN;
 
			SetWindowClassesDirty(WC_VEHICLE_ORDERS);
 
			SetWindowWidgetDirty(WC_STATION_VIEW, st->index, WID_SV_TRAINS);
 
			MarkCatchmentTilesDirty();
 
			st->UpdateVirtCoord();
 
			DeleteStationIfEmpty(st);
 
		}
 
	}
 
@@ -2139,12 +2140,13 @@ static CommandCost RemoveRoadStop(TileIn
 
		if (*primary_stop == cur_stop) {
 
			/* removed the first stop in the list */
 
			*primary_stop = cur_stop->next;
 
			/* removed the only stop? */
 
			if (*primary_stop == nullptr) {
 
				st->facilities &= (is_truck ? ~FACIL_TRUCK_STOP : ~FACIL_BUS_STOP);
 
				SetWindowClassesDirty(WC_VEHICLE_ORDERS);
 
			}
 
		} else {
 
			/* tell the predecessor in the list to skip this stop */
 
			RoadStop *pred = *primary_stop;
 
			while (pred->next != cur_stop) pred = pred->next;
 
			pred->next = cur_stop->next;
 
@@ -2571,12 +2573,13 @@ static CommandCost RemoveAirport(TileInd
 
		delete st->airport.psa;
 

	
 
		st->rect.AfterRemoveRect(st, st->airport);
 

	
 
		st->airport.Clear();
 
		st->facilities &= ~FACIL_AIRPORT;
 
		SetWindowClassesDirty(WC_VEHICLE_ORDERS);
 

	
 
		InvalidateWindowData(WC_STATION_VIEW, st->index, -1);
 

	
 
		Company::Get(st->owner)->infrastructure.airport--;
 

	
 
		st->AfterStationTileSetChange(false, STATION_AIRPORT);
 
@@ -2824,12 +2827,13 @@ static CommandCost RemoveDock(TileIndex 
 

	
 
		MakeShipStationAreaSmaller(st);
 
		if (st->ship_station.tile == INVALID_TILE) {
 
			st->ship_station.Clear();
 
			st->docking_station.Clear();
 
			st->facilities &= ~FACIL_DOCK;
 
			SetWindowClassesDirty(WC_VEHICLE_ORDERS);
 
		}
 

	
 
		Company::Get(st->owner)->infrastructure.station -= 2;
 

	
 
		st->AfterStationTileSetChange(false, STATION_DOCK);
 

	
0 comments (0 inline, 0 general)