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

Function updateSeason

src/OpenLoco/src/Scenario/Scenario.cpp:84–101  ·  view source on GitHub ↗

0x00496A18, 0x00496A84 (adapted)

Source from the content-addressed store, hash-verified

82
83 // 0x00496A18, 0x00496A84 (adapted)
84 void updateSeason(int32_t currentDayOfYear, const ClimateObject* climateObj)
85 {
86 Season season = static_cast<Season>(climateObj->firstSeason);
87
88 int32_t dayOffset = currentDayOfYear;
89 for (size_t i = 0; i < std::size(climateObj->seasonLength); i++)
90 {
91 dayOffset -= climateObj->seasonLength[i];
92 if (dayOffset < 0)
93 {
94 break;
95 }
96
97 season = nextSeason(season);
98 }
99
100 setCurrentSeason(season);
101 }
102
103 // 0x00496A18
104 void initialiseSnowLine()

Callers 3

initFunction · 0.85
initialiseSnowLineFunction · 0.85
updateSnowLineFunction · 0.85

Calls 2

nextSeasonFunction · 0.85
setCurrentSeasonFunction · 0.85

Tested by

no test coverage detected