diff --git a/data/uking_functions.csv b/data/uking_functions.csv index 913929c7..f48a7fac 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -90131,13 +90131,13 @@ Address,Quality,Size,Name 0x00000071010f2f24,O,000008,_ZNK4ksys5world7Manager17getCurrentClimateEv 0x00000071010f2f2c,O,000008,_ZNK4ksys5world7Manager14getPrevClimateEv 0x00000071010f2f34,O,000008,_ZNK4ksys5world7Manager28getClimateTransitionProgressEv -0x00000071010f2f3c,U,000972,WorldMgr::someWeatherStuff_0 +0x00000071010f2f3c,U,000972,_ZNK4ksys5world7Manager14getWeatherTypeENS0_7ClimateE 0x00000071010f3308,U,000044,WorldMgr::x_14 0x00000071010f3334,O,000032,_ZNK4ksys5world7Manager16isDayLockBlueSkyENS0_7ClimateE 0x00000071010f3354,O,000032,_ZNK4ksys5world7Manager18isNightLockBlueSkyENS0_7ClimateE 0x00000071010f3374,U,000008,WorldMgr::__auto13 0x00000071010f337c,U,000040,_ZN4ksys5world7Manager14sub_71010F337CERKN4sead7Vector3IfEE -0x00000071010f33a4,U,000084,WorldMgr::isRaining +0x00000071010f33a4,O,000084,_ZNK4ksys5world7Manager9isRainingERKN4sead7Vector3IfEE 0x00000071010f33f8,O,000452,_ZNK4ksys5world7Manager11calcTempDayEf 0x00000071010f35bc,O,000452,_ZNK4ksys5world7Manager13calcTempNightEf 0x00000071010f3780,O,000068,_ZNK4ksys5world7Manager14getMoistureMaxEv diff --git a/src/KingSystem/World/worldManager.cpp b/src/KingSystem/World/worldManager.cpp index 9265b0b1..16aa90cb 100644 --- a/src/KingSystem/World/worldManager.cpp +++ b/src/KingSystem/World/worldManager.cpp @@ -136,6 +136,19 @@ bool Manager::isNightLockBlueSky(Climate climate) const { return mWorldInfo.mClimates[int(climate)].NightLockBlueSky.ref(); } +bool Manager::isRaining(const sead::Vector3f& pos) const { + const Climate climate = getClimate(pos); + switch (getWeatherType(climate)) { + case WeatherType::Rain: + case WeatherType::HeavyRain: + case WeatherType::ThunderRain: + case WeatherType::BlueskyRain: + return true; + default: + return false; + } +} + float Manager::calcTempDay(float height) const { float normal_temp = 23.0f; diff --git a/src/KingSystem/World/worldManager.h b/src/KingSystem/World/worldManager.h index 159ebd8d..d0da5464 100644 --- a/src/KingSystem/World/worldManager.h +++ b/src/KingSystem/World/worldManager.h @@ -221,6 +221,8 @@ private: Unloaded, }; + WeatherType getWeatherType(Climate climate) const; + void overrideWindSpeed(float* wind_speed) const; void calcManagers(sead::WorkerMgr* worker_mgr);