MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / DeleteStationIfEmpty

Function DeleteStationIfEmpty

src/station_cmd.cpp:724–732  ·  view source on GitHub ↗

* This is called right after a station was deleted. * It checks if the whole station is free of substations, and if so, the station will be * deleted after a little while. * @param st Station */

Source from the content-addressed store, hash-verified

722 * @param st Station
723 */
724static void DeleteStationIfEmpty(BaseStation *st)
725{
726 if (!st->IsInUse()) {
727 st->delete_ctr = 0;
728 InvalidateWindowData(WC_STATION_LIST, st->owner, 0);
729 }
730 /* station remains but it probably lost some parts - station sign should stay in the station boundaries */
731 UpdateStationSignCoord(st);
732}
733
734/**
735 * After adding/removing tiles to station, update some station-related stuff.

Callers 3

RemoveRoadWaypointStopFunction · 0.85

Calls 3

UpdateStationSignCoordFunction · 0.85
IsInUseMethod · 0.80
InvalidateWindowDataFunction · 0.70

Tested by

no test coverage detected