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

Function OnTick_Industry

src/industry_cmd.cpp:1233–1255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1231}
1232
1233void OnTick_Industry()
1234{
1235 if (_industry_sound_ctr != 0) {
1236 _industry_sound_ctr++;
1237
1238 if (_industry_sound_ctr == 75) {
1239 if (_settings_client.sound.ambient) SndPlayTileFx(SND_37_LUMBER_MILL_2, _industry_sound_tile);
1240 } else if (_industry_sound_ctr == 160) {
1241 _industry_sound_ctr = 0;
1242 if (_settings_client.sound.ambient) SndPlayTileFx(SND_36_LUMBER_MILL_3, _industry_sound_tile);
1243 }
1244 }
1245
1246 if (_game_mode == GM_EDITOR) return;
1247
1248 for (Industry *i : Industry::Iterate()) {
1249 ProduceIndustryGoods(i);
1250
1251 if ((TimerGameTick::counter + i->index) % Ticks::DAY_TICKS == 0) {
1252 for (auto &a : i->accepted) a.accumulated_waiting += a.waiting;
1253 }
1254 }
1255}
1256
1257/**
1258 * Check the conditions of #CHECK_NOTHING (Always succeeds).

Callers 1

CallLandscapeTickFunction · 0.85

Calls 2

SndPlayTileFxFunction · 0.85
ProduceIndustryGoodsFunction · 0.85

Tested by

no test coverage detected