1
0
Fork 0

Fix: Redraw orders when a station feature is added/removed.

pull/12061/head
J0anJosep 2024-01-01 14:04:40 +01:00
parent d02b1547f6
commit f25edb60a0
2 changed files with 5 additions and 0 deletions

View File

@ -233,6 +233,7 @@ void Station::AddFacility(StationFacility new_facility_bit, TileIndex facil_xy)
this->facilities |= new_facility_bit; this->facilities |= new_facility_bit;
this->owner = _current_company; this->owner = _current_company;
this->build_date = TimerGameCalendar::date; this->build_date = TimerGameCalendar::date;
SetWindowClassesDirty(WC_VEHICLE_ORDERS);
} }
/** /**

View File

@ -1695,6 +1695,7 @@ CommandCost RemoveFromRailBaseStation(TileArea ta, std::vector<T *> &affected_st
/* if we deleted the whole station, delete the train facility. */ /* if we deleted the whole station, delete the train facility. */
if (st->train_station.tile == INVALID_TILE) { if (st->train_station.tile == INVALID_TILE) {
st->facilities &= ~FACIL_TRAIN; st->facilities &= ~FACIL_TRAIN;
SetWindowClassesDirty(WC_VEHICLE_ORDERS);
SetWindowWidgetDirty(WC_STATION_VIEW, st->index, WID_SV_TRAINS); SetWindowWidgetDirty(WC_STATION_VIEW, st->index, WID_SV_TRAINS);
MarkCatchmentTilesDirty(); MarkCatchmentTilesDirty();
st->UpdateVirtCoord(); st->UpdateVirtCoord();
@ -2142,6 +2143,7 @@ static CommandCost RemoveRoadStop(TileIndex tile, DoCommandFlag flags, int repla
/* removed the only stop? */ /* removed the only stop? */
if (*primary_stop == nullptr) { if (*primary_stop == nullptr) {
st->facilities &= (is_truck ? ~FACIL_TRUCK_STOP : ~FACIL_BUS_STOP); st->facilities &= (is_truck ? ~FACIL_TRUCK_STOP : ~FACIL_BUS_STOP);
SetWindowClassesDirty(WC_VEHICLE_ORDERS);
} }
} else { } else {
/* tell the predecessor in the list to skip this stop */ /* tell the predecessor in the list to skip this stop */
@ -2574,6 +2576,7 @@ static CommandCost RemoveAirport(TileIndex tile, DoCommandFlag flags)
st->airport.Clear(); st->airport.Clear();
st->facilities &= ~FACIL_AIRPORT; st->facilities &= ~FACIL_AIRPORT;
SetWindowClassesDirty(WC_VEHICLE_ORDERS);
InvalidateWindowData(WC_STATION_VIEW, st->index, -1); InvalidateWindowData(WC_STATION_VIEW, st->index, -1);
@ -2827,6 +2830,7 @@ static CommandCost RemoveDock(TileIndex tile, DoCommandFlag flags)
st->ship_station.Clear(); st->ship_station.Clear();
st->docking_station.Clear(); st->docking_station.Clear();
st->facilities &= ~FACIL_DOCK; st->facilities &= ~FACIL_DOCK;
SetWindowClassesDirty(WC_VEHICLE_ORDERS);
} }
Company::Get(st->owner)->infrastructure.station -= 2; Company::Get(st->owner)->infrastructure.station -= 2;