diff --git a/apps/openmw/mwworld/weather.cpp b/apps/openmw/mwworld/weather.cpp index 5d739a9161..aa75730b40 100644 --- a/apps/openmw/mwworld/weather.cpp +++ b/apps/openmw/mwworld/weather.cpp @@ -898,36 +898,27 @@ namespace MWWorld { if (ESM::REC_WTHR == type) { - if (reader.getFormatVersion() <= ESM::MaxOldWeatherFormatVersion) + ESM::WeatherState state; + state.load(reader); + + std::swap(mCurrentRegion, state.mCurrentRegion); + mTimePassed = state.mTimePassed; + mFastForward = state.mFastForward; + mWeatherUpdateTime = state.mWeatherUpdateTime; + mTransitionFactor = state.mTransitionFactor; + mCurrentWeather = state.mCurrentWeather; + mNextWeather = state.mNextWeather; + mQueuedWeather = state.mQueuedWeather; + + mRegions.clear(); + importRegions(); + + for (auto it = state.mRegions.begin(); it != state.mRegions.end(); ++it) { - // 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); - - std::swap(mCurrentRegion, state.mCurrentRegion); - mTimePassed = state.mTimePassed; - mFastForward = state.mFastForward; - mWeatherUpdateTime = state.mWeatherUpdateTime; - mTransitionFactor = state.mTransitionFactor; - mCurrentWeather = state.mCurrentWeather; - mNextWeather = state.mNextWeather; - mQueuedWeather = state.mQueuedWeather; - - mRegions.clear(); - importRegions(); - - for (auto it = state.mRegions.begin(); it != state.mRegions.end(); ++it) + auto found = mRegions.find(it->first); + if (found != mRegions.end()) { - auto found = mRegions.find(it->first); - if (found != mRegions.end()) - { - found->second = RegionWeather(it->second); - } + found->second = RegionWeather(it->second); } } diff --git a/components/esm3/creaturestats.cpp b/components/esm3/creaturestats.cpp index 8281916e30..a393da697f 100644 --- a/components/esm3/creaturestats.cpp +++ b/components/esm3/creaturestats.cpp @@ -49,8 +49,6 @@ namespace ESM esm.getHNOT(mTalkedTo, "TALK"); esm.getHNOT(mAlarmed, "ALRM"); esm.getHNOT(mAttacked, "ATKD"); - if (esm.isNextSub("ATCK")) - esm.skipHSub(); // attackingOrSpell, no longer used esm.getHNOT(mKnockdown, "KNCK"); esm.getHNOT(mKnockdownOneFrame, "KNC1"); esm.getHNOT(mKnockdownOverOneFrame, "KNCO"); diff --git a/components/esm3/formatversion.hpp b/components/esm3/formatversion.hpp index e02e0176a9..82fff88614 100644 --- a/components/esm3/formatversion.hpp +++ b/components/esm3/formatversion.hpp @@ -9,7 +9,6 @@ namespace ESM inline constexpr FormatVersion DefaultFormatVersion = 0; inline constexpr FormatVersion CurrentContentFormatVersion = 1; - inline constexpr FormatVersion MaxOldWeatherFormatVersion = 1; inline constexpr FormatVersion MaxOldDeathAnimationFormatVersion = 2; inline constexpr FormatVersion MaxOldFogOfWarFormatVersion = 6; inline constexpr FormatVersion MaxUnoptimizedCharacterDataFormatVersion = 7; @@ -28,7 +27,7 @@ namespace ESM inline constexpr FormatVersion MaxActiveSpellSlotIndexFormatVersion = 27; inline constexpr FormatVersion CurrentSaveGameFormatVersion = 29; - inline constexpr FormatVersion MinSupportedSaveGameFormatVersion = 1; + inline constexpr FormatVersion MinSupportedSaveGameFormatVersion = 2; inline constexpr FormatVersion OpenMW0_48SaveGameFormatVersion = 21; inline constexpr FormatVersion OpenMW0_49SaveGameFormatVersion = CurrentSaveGameFormatVersion; }