From 55e670c5fec4226a5448a52db0eab3f765cd1395 Mon Sep 17 00:00:00 2001 From: MiroslavR Date: Thu, 15 Sep 2016 16:11:54 +0200 Subject: [PATCH] Fix animation state not saving References with animation state changed but otherwise identical to their content file counterparts were previously considered unchanged and thus dropped while saving. --- apps/openmw/mwworld/refdata.cpp | 2 +- components/esm/animationstate.cpp | 5 +++++ components/esm/animationstate.hpp | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwworld/refdata.cpp b/apps/openmw/mwworld/refdata.cpp index ebc38ac9b5..de26d1292a 100644 --- a/apps/openmw/mwworld/refdata.cpp +++ b/apps/openmw/mwworld/refdata.cpp @@ -238,7 +238,7 @@ namespace MWWorld bool RefData::hasChanged() const { - return mChanged; + return mChanged || !mAnimationState.empty(); } bool RefData::activate() diff --git a/components/esm/animationstate.cpp b/components/esm/animationstate.cpp index 52dde258f2..79dcad7578 100644 --- a/components/esm/animationstate.cpp +++ b/components/esm/animationstate.cpp @@ -5,6 +5,11 @@ namespace ESM { + bool AnimationState::empty() const + { + return mScriptedAnims.empty(); + } + void AnimationState::load(ESMReader& esm) { mScriptedAnims.clear(); diff --git a/components/esm/animationstate.hpp b/components/esm/animationstate.hpp index 73b6a41d0a..ce2c437dfc 100644 --- a/components/esm/animationstate.hpp +++ b/components/esm/animationstate.hpp @@ -26,6 +26,8 @@ namespace ESM typedef std::vector ScriptedAnimations; ScriptedAnimations mScriptedAnims; + bool empty() const; + void load(ESMReader& esm); void save(ESMWriter& esm) const; };