MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / isFarmTileProducing

Method isFarmTileProducing

src/OpenLoco/src/World/Industry.cpp:411–434  ·  view source on GitHub ↗

0x0045329B

Source from the content-addressed store, hash-verified

409
410 // 0x0045329B
411 void Industry::isFarmTileProducing(const Pos2& pos)
412 {
413 const auto& surface = TileManager::get(pos).surface();
414 if (surface != nullptr)
415 {
416 if (surface->isIndustrial())
417 {
418 if (surface->industryId() == id())
419 {
420 uint8_t growthStage = surface->getGrowthStage();
421 const auto* obj = getObject();
422 if (growthStage == 0 || growthStage != obj->farmTileGrowthStageNoProduction)
423 {
424 // loc_4532E5
425 numFarmTiles++;
426 if ((!obj->hasFlags(IndustryObjectFlags::farmProductionIgnoresSnow) && surface->snowCoverage() != 0) || findTree(surface))
427 {
428 numIdleFarmTiles++;
429 }
430 }
431 }
432 }
433 }
434 }
435
436 void Industry::calculateFarmProduction()
437 {

Callers

nothing calls this directly

Calls 8

findTreeFunction · 0.85
surfaceMethod · 0.80
isIndustrialMethod · 0.80
getGrowthStageMethod · 0.80
snowCoverageMethod · 0.80
getFunction · 0.70
industryIdMethod · 0.45
hasFlagsMethod · 0.45

Tested by

no test coverage detected