1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 22:34:33 +01:00

Purge old climate setting from gamestate

This commit is contained in:
Aaron van Geffen
2025-02-04 16:25:17 +01:00
parent c7e364c8dd
commit 8eb8f045b5
9 changed files with 9 additions and 16 deletions

View File

@@ -309,7 +309,7 @@ namespace OpenRCT2::Editor
gameState.BankLoanInterestRate = std::clamp<uint8_t>(gameState.BankLoanInterestRate, 5, MaxBankLoanInterestRate);
}
ClimateReset(gameState.Climate);
ClimateReset();
News::InitQueue();
}

View File

@@ -64,7 +64,7 @@ namespace OpenRCT2
ResetAllEntities();
UpdateConsolidatedPatrolAreas();
ResetDate();
ClimateReset(ClimateType::CoolAndWet);
ClimateReset();
News::InitQueue();
gInMapInitCode = false;

View File

@@ -48,7 +48,6 @@ namespace OpenRCT2
money64 CurrentExpenditure;
money64 CurrentProfit;
uint32_t GuestsInParkHistory[kGuestsInParkHistorySize];
ClimateType Climate;
WeatherState WeatherCurrent;
WeatherState WeatherNext;
uint16_t WeatherUpdateTimer;

View File

@@ -49,7 +49,7 @@ GameActions::Result ClimateSetAction::Query() const
GameActions::Result ClimateSetAction::Execute() const
{
ClimateReset(_climate);
ClimateReset();
GfxInvalidateScreen();

View File

@@ -2359,9 +2359,6 @@ namespace OpenRCT2::RCT1
void ImportClimate(GameState_t& gameState)
{
// TODO: remove
gameState.Climate = ClimateType{ _s4.Climate };
gameState.WeatherUpdateTimer = _s4.WeatherUpdateTimer;
gameState.WeatherCurrent = {
.weatherType = WeatherType{ _s4.Weather },

View File

@@ -552,10 +552,7 @@ namespace OpenRCT2::RCT2
// unk_13CA73E
// Pad13CA73F
// unk_13CA740
// TODO: remove
gameState.Climate = ClimateType{ _s6.Climate };
// gameState.Climate = ClimateType{ _s6.Climate };
// Pad13CA741;
// Byte13CA742
// Pad013CA747

View File

@@ -53,6 +53,7 @@ namespace OpenRCT2::Scripting
class ScClimate
{
public:
// TODO: replace with climate object
static std::string ClimateTypeToString(ClimateType token)
{
switch (token)
@@ -101,8 +102,8 @@ namespace OpenRCT2::Scripting
std::string type_get() const
{
auto& gameState = GetGameState();
return ClimateTypeToString(gameState.Climate);
// TODO: from climate object
return "";
}
std::shared_ptr<ScWeatherState> current_get() const

View File

@@ -87,7 +87,7 @@ int32_t ClimateCelsiusToFahrenheit(int32_t celsius)
/**
* Set climate and determine start weather.
*/
void ClimateReset(ClimateType climate)
void ClimateReset()
{
auto& objManager = GetContext()->GetObjectManager();
auto* climateObj = objManager.GetLoadedObject<ClimateObject>(0);
@@ -101,7 +101,6 @@ void ClimateReset(ClimateType climate)
const WeatherTrait& trait = kClimateWeatherTraits[EnumValue(weather)];
auto& gameState = GetGameState();
gameState.Climate = climate;
gameState.WeatherCurrent.weatherType = weather;
gameState.WeatherCurrent.temperature = pattern.baseTemperature + trait.temperatureDelta;
gameState.WeatherCurrent.weatherEffect = trait.effectLevel;

View File

@@ -79,7 +79,7 @@ struct WeatherState
extern uint16_t gClimateLightningFlash;
int32_t ClimateCelsiusToFahrenheit(int32_t celsius);
void ClimateReset(ClimateType climate);
void ClimateReset();
void ClimateUpdate();
void ClimateUpdateSound();
void ClimateStopWeatherSound();