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

Method AddFacility

src/station.cpp:230–240  ·  view source on GitHub ↗

* Called when new facility is built on the station. If it is the first facility * it initializes also 'xy' and 'random_bits' members */

Source from the content-addressed store, hash-verified

228 * it initializes also 'xy' and 'random_bits' members
229 */
230void Station::AddFacility(StationFacility new_facility_bit, TileIndex facil_xy)
231{
232 if (this->facilities.None()) {
233 this->MoveSign(facil_xy);
234 this->random_bits = Random();
235 }
236 this->facilities.Set(new_facility_bit);
237 this->owner = _current_company;
238 this->build_date = TimerGameCalendar::date;
239 SetWindowClassesDirty(WC_VEHICLE_ORDERS);
240}
241
242/**
243 * Marks the tiles of the station as dirty.

Callers 4

CmdBuildRailStationFunction · 0.80
CmdBuildRoadStopFunction · 0.80
CmdBuildAirportFunction · 0.80
CmdBuildDockFunction · 0.80

Calls 5

MoveSignMethod · 0.95
SetWindowClassesDirtyFunction · 0.85
NoneMethod · 0.80
RandomFunction · 0.50
SetMethod · 0.45

Tested by

no test coverage detected