forked from mirror/openmw-tes3mp
WeatherManager: fix for cells that have no region.
This commit is contained in:
parent
0afda15ce9
commit
375c198ebd
1 changed files with 38 additions and 35 deletions
|
@ -499,15 +499,17 @@ void WeatherManager::update(float duration)
|
|||
mCurrentRegion = regionstr;
|
||||
mWeatherUpdateTime = WeatherGlobals::mWeatherUpdateTime*3600;
|
||||
|
||||
std::string weather;
|
||||
std::string weather = "clear";
|
||||
|
||||
if (mRegionOverrides.find(regionstr) != mRegionOverrides.end())
|
||||
weather = mRegionOverrides[regionstr];
|
||||
else
|
||||
{
|
||||
// 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 cloudy = region->data.cloudy/255.f;
|
||||
float foggy = region->data.foggy/255.f;
|
||||
|
@ -545,6 +547,7 @@ void WeatherManager::update(float duration)
|
|||
else
|
||||
weather = "clear";
|
||||
}
|
||||
}
|
||||
|
||||
setWeather(weather, false);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue