1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-08 09:37:53 +00:00

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

Import base weather states before loading region modifiers
This commit is contained in:
scrawl 2016-10-15 22:17:20 +02:00 committed by GitHub
commit 1d58733880

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);
} }
} }
} }