diff options
Diffstat (limited to 'src/KingSystem/World/worldManager.cpp')
| -rw-r--r-- | src/KingSystem/World/worldManager.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/KingSystem/World/worldManager.cpp b/src/KingSystem/World/worldManager.cpp index 0fe61d70..cd2d9853 100644 --- a/src/KingSystem/World/worldManager.cpp +++ b/src/KingSystem/World/worldManager.cpp @@ -66,18 +66,18 @@ WeatherType Manager::getWeatherType() const { return mWeatherType; } -void Manager::setWeatherType(WeatherType weather_type, bool x, bool y, bool for_demo) { +void Manager::setWeatherType(u32 weather_type, bool x, bool y, bool for_demo) { // Ignore invalid weather requests. - if (u32(weather_type) >= NumWeatherTypes) + if (weather_type >= NumWeatherTypes) return; if (mWeatherSetForDemo && !for_demo) return; - if (mWeatherTypeTimer != 0 && y && mWeatherType.mValue > u8(weather_type)) + if (mWeatherTypeTimer != 0 && y && mWeatherType > WeatherType(weather_type)) return; - mWeatherType = weather_type; + mWeatherType = WeatherType(weather_type); mWeatherTypeTimer = 4; _7d5 = x; mWeatherSetForDemo = for_demo; @@ -86,15 +86,15 @@ void Manager::setWeatherType(WeatherType weather_type, bool x, bool y, bool for_ void Manager::setWeatherType(const sead::SafeString& weather_type, bool x, bool y, bool for_demo) { for (u8 i = 0; i < NumWeatherTypes; ++i) { if (weather_type == cWeatherTypes[i]) { - setWeatherType(WeatherType(i), x, y, for_demo); + setWeatherType(i, x, y, for_demo); return; } } } -const char* Manager::getWeatherTypeString(WeatherType type) { - auto index = ptrdiff_t(type); - if (u32(index) >= NumWeatherTypes) +const char* Manager::getWeatherTypeString(u32 type) { + auto index = s32(type); + if (type >= NumWeatherTypes) index = 0; return cWeatherTypes[index].cstr(); } |
