mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-27 15:11:36 -04:00
WeatherManager: fix for cells that have no region.
This commit is contained in:
parent
0afda15ce9
commit
375c198ebd
@ -499,15 +499,17 @@ void WeatherManager::update(float duration)
|
|||||||
mCurrentRegion = regionstr;
|
mCurrentRegion = regionstr;
|
||||||
mWeatherUpdateTime = WeatherGlobals::mWeatherUpdateTime*3600;
|
mWeatherUpdateTime = WeatherGlobals::mWeatherUpdateTime*3600;
|
||||||
|
|
||||||
std::string weather;
|
std::string weather = "clear";
|
||||||
|
|
||||||
if (mRegionOverrides.find(regionstr) != mRegionOverrides.end())
|
if (mRegionOverrides.find(regionstr) != mRegionOverrides.end())
|
||||||
weather = mRegionOverrides[regionstr];
|
weather = mRegionOverrides[regionstr];
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// get weather probabilities for the current region
|
// get weather probabilities for the current region
|
||||||
const ESM::Region *region = MWBase::Environment::get().getWorld()->getStore().regions.find (regionstr);
|
const ESM::Region *region = MWBase::Environment::get().getWorld()->getStore().regions.search (regionstr);
|
||||||
|
|
||||||
|
if (region != 0)
|
||||||
|
{
|
||||||
float clear = region->data.clear/255.f;
|
float clear = region->data.clear/255.f;
|
||||||
float cloudy = region->data.cloudy/255.f;
|
float cloudy = region->data.cloudy/255.f;
|
||||||
float foggy = region->data.foggy/255.f;
|
float foggy = region->data.foggy/255.f;
|
||||||
@ -545,6 +547,7 @@ void WeatherManager::update(float duration)
|
|||||||
else
|
else
|
||||||
weather = "clear";
|
weather = "clear";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setWeather(weather, false);
|
setWeather(weather, false);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user