Import base weather states before loading region modifiers (Fixes #3594)

This commit is contained in:
MiroslavR 2016-10-15 17:34:03 +02:00
parent 9e63c3ce63
commit 7b59eda13a

View file

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