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

Method PlayLeaveStationSound

src/train_cmd.cpp:2215–2228  ·  view source on GitHub ↗

Play a sound for a train leaving the station. */

Source from the content-addressed store, hash-verified

2213
2214/** Play a sound for a train leaving the station. */
2215void Train::PlayLeaveStationSound(bool force) const
2216{
2217 static const SoundFx sfx[] = {
2218 SND_04_DEPARTURE_STEAM,
2219 SND_0A_DEPARTURE_TRAIN,
2220 SND_0A_DEPARTURE_TRAIN,
2221 SND_47_DEPARTURE_MONORAIL,
2222 SND_41_DEPARTURE_MAGLEV
2223 };
2224
2225 if (PlayVehicleSound(this, VSE_START, force)) return;
2226
2227 SndPlayVehicleFx(sfx[RailVehInfo(this->engine_type)->engclass], this);
2228}
2229
2230/**
2231 * Check if the train is on the last reserved tile and try to extend the path then.

Callers 1

CheckTrainStayInDepotFunction · 0.45

Calls 3

PlayVehicleSoundFunction · 0.85
SndPlayVehicleFxFunction · 0.85
RailVehInfoFunction · 0.85

Tested by

no test coverage detected