Merge pull request #1104 from MiroslavR/missing-weather-states

Import base weather states before loading region modifiers
coverity_scan^2
scrawl 8 years ago committed by GitHub
commit 1d58733880

@ -832,17 +832,14 @@ bool WeatherManager::readRecord(ESM::ESMReader& reader, uint32_t type)
mQueuedWeather = state.mQueuedWeather;
mRegions.clear();
std::map<std::string, ESM::RegionWeatherState>::iterator it = state.mRegions.begin();
if(it == state.mRegions.end())
{
// When loading an imported save, the region modifiers aren't currently being set, so just reset them.
importRegions();
}
else
importRegions();
for(std::map<std::string, ESM::RegionWeatherState>::iterator it = state.mRegions.begin(); it != state.mRegions.end(); ++it)
{
for(; it != state.mRegions.end(); ++it)
std::map<std::string, RegionWeather>::iterator found = mRegions.find(it->first);
if (found != mRegions.end())
{
mRegions.insert(std::make_pair(it->first, RegionWeather(it->second)));
found->second = RegionWeather(it->second);
}
}
}

Loading…
Cancel
Save