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

Function updateYearly

src/OpenLoco/src/Map/TileManager.cpp:1585–1611  ·  view source on GitHub ↗

0x0047AB9B

Source from the content-addressed store, hash-verified

1583
1584 // 0x0047AB9B
1585 void updateYearly()
1586 {
1587 const auto isObjectAnyRoadTypeCompatible = getGameState().roadObjectIdIsAnyRoadTypeCompatible;
1588 for (const auto& tilePos : getWorldRange())
1589 {
1590 auto tile = get(tilePos);
1591 for (auto& el : tile)
1592 {
1593 auto* elRoad = el.as<RoadElement>();
1594 if (elRoad == nullptr)
1595 {
1596 continue;
1597 }
1598 if (elRoad->isAiAllocated() || elRoad->isGhost())
1599 {
1600 continue;
1601 }
1602 // This is a much cheaper tram checker
1603 // compared to getting the object
1604 if (isObjectAnyRoadTypeCompatible & (1U << elRoad->roadObjectId()))
1605 {
1606 elRoad->setUnk7_80(elRoad->hasUnk7_40());
1607 elRoad->setUnk7_40(false);
1608 }
1609 }
1610 }
1611 }
1612}

Callers

nothing calls this directly

Calls 8

getWorldRangeFunction · 0.85
isAiAllocatedMethod · 0.80
roadObjectIdMethod · 0.80
setUnk7_80Method · 0.80
hasUnk7_40Method · 0.80
setUnk7_40Method · 0.80
getFunction · 0.70
isGhostMethod · 0.45

Tested by

no test coverage detected