From 38bda3bd710a7cabb8168d1c9785c561d1ad4aa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Thu, 23 Nov 2017 18:00:10 +0100 Subject: [PATCH] Do not save thrown state for projectiles --- apps/openmw/mwworld/projectilemanager.cpp | 4 +--- components/esm/projectilestate.cpp | 4 ---- components/esm/projectilestate.hpp | 1 - 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/apps/openmw/mwworld/projectilemanager.cpp b/apps/openmw/mwworld/projectilemanager.cpp index d38931700..707e8b193 100644 --- a/apps/openmw/mwworld/projectilemanager.cpp +++ b/apps/openmw/mwworld/projectilemanager.cpp @@ -565,8 +565,6 @@ namespace MWWorld state.mVelocity = it->mVelocity; state.mAttackStrength = it->mAttackStrength; - state.mThrown = it->mThrown; - state.save(writer); writer.endRecord(ESM::REC_PROJ); @@ -604,7 +602,6 @@ namespace MWWorld state.mVelocity = esm.mVelocity; state.mIdArrow = esm.mId; state.mAttackStrength = esm.mAttackStrength; - state.mThrown = esm.mThrown; std::string model; try @@ -612,6 +609,7 @@ namespace MWWorld MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(), esm.mId); MWWorld::Ptr ptr = ref.getPtr(); model = ptr.getClass().getModel(ptr); + state.mThrown = ptr.get()->mBase->mData.mType == ESM::Weapon::MarksmanThrown; } catch(...) { diff --git a/components/esm/projectilestate.cpp b/components/esm/projectilestate.cpp index 7b6c419f2..8ade9d5b2 100644 --- a/components/esm/projectilestate.cpp +++ b/components/esm/projectilestate.cpp @@ -52,7 +52,6 @@ namespace ESM esm.writeHNString ("BOW_", mBowId); esm.writeHNT ("VEL_", mVelocity); esm.writeHNT ("STR_", mAttackStrength); - esm.writeHNT ("THR_", mThrown); } void ProjectileState::load(ESMReader &esm) @@ -64,9 +63,6 @@ namespace ESM mAttackStrength = 1.f; esm.getHNOT(mAttackStrength, "STR_"); - - mThrown = false; - esm.getHNOT (mThrown, "THR_"); } } diff --git a/components/esm/projectilestate.hpp b/components/esm/projectilestate.hpp index c89bb7683..67ec89bb6 100644 --- a/components/esm/projectilestate.hpp +++ b/components/esm/projectilestate.hpp @@ -42,7 +42,6 @@ namespace ESM std::string mBowId; Vector3 mVelocity; float mAttackStrength; - bool mThrown; void load (ESMReader &esm); void save (ESMWriter &esm) const;