@@ -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
@@ -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;
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);
} 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;
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;
Company::Get(st->owner)->infrastructure.station -= 2;
st->AfterStationTileSetChange(false, STATION_DOCK);
Status change: