|
|
|
@ -5,7 +5,9 @@
|
|
|
|
|
|
|
|
|
|
#include <components/misc/rng.hpp>
|
|
|
|
|
|
|
|
|
|
#include <components/esm/esmreader.hpp>
|
|
|
|
|
#include <components/esm/esmwriter.hpp>
|
|
|
|
|
#include <components/esm/savedgame.hpp>
|
|
|
|
|
#include <components/esm/weatherstate.hpp>
|
|
|
|
|
|
|
|
|
|
#include "../mwbase/environment.hpp"
|
|
|
|
@ -722,6 +724,14 @@ void WeatherManager::write(ESM::ESMWriter& writer, Loading::Listener& progress)
|
|
|
|
|
bool WeatherManager::readRecord(ESM::ESMReader& reader, uint32_t type)
|
|
|
|
|
{
|
|
|
|
|
if(ESM::REC_WTHR == type)
|
|
|
|
|
{
|
|
|
|
|
if(reader.getFormat() < ESM::SavedGame::sCurrentFormat)
|
|
|
|
|
{
|
|
|
|
|
// Weather state isn't really all that important, so to preserve older save games, we'll just discard the
|
|
|
|
|
// older weather records, rather than fail to handle the record.
|
|
|
|
|
reader.skipRecord();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ESM::WeatherState state;
|
|
|
|
|
state.load(reader);
|
|
|
|
@ -749,6 +759,7 @@ bool WeatherManager::readRecord(ESM::ESMReader& reader, uint32_t type)
|
|
|
|
|
mRegions.insert(std::make_pair(it->first, RegionWeather(it->second)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|