diff --git a/apps/openmw/mwmechanics/aicombat.cpp b/apps/openmw/mwmechanics/aicombat.cpp index 17005f235..d111eb127 100644 --- a/apps/openmw/mwmechanics/aicombat.cpp +++ b/apps/openmw/mwmechanics/aicombat.cpp @@ -500,8 +500,7 @@ namespace MWMechanics { // get the range of the target's weapon float rangeAttackOfTarget = 0.f; - bool isRangedCombat = false; - MWWorld::Ptr targetWeapon = MWWorld::Ptr(); + MWWorld::Ptr targetWeapon = MWWorld::Ptr(); const MWWorld::Class& targetClass = target.getClass(); if (targetClass.hasInventoryStore(target)) @@ -516,7 +515,10 @@ namespace MWMechanics boost::shared_ptr targetWeaponAction (new ActionWeapon(targetWeapon)); if (targetWeaponAction.get()) + { + bool isRangedCombat = false; rangeAttackOfTarget = targetWeaponAction->getCombatRange(isRangedCombat); + } // apply sideway movement (kind of dodging) with some probability // if actor is within range of target's weapon diff --git a/apps/openmw/mwmechanics/alchemy.cpp b/apps/openmw/mwmechanics/alchemy.cpp index 783bbf573..e6e3b4c4e 100644 --- a/apps/openmw/mwmechanics/alchemy.cpp +++ b/apps/openmw/mwmechanics/alchemy.cpp @@ -171,10 +171,10 @@ void MWMechanics::Alchemy::updateEffects() if (fPotionT1DurMult<=0) throw std::runtime_error ("invalid gmst: fPotionT1DurMult"); - float magnitude = magicEffect->mData.mFlags & ESM::MagicEffect::NoMagnitude ? - 1 : (x / fPotionT1MagMul) / magicEffect->mData.mBaseCost; - float duration = magicEffect->mData.mFlags & ESM::MagicEffect::NoDuration ? - 1 : (x / fPotionT1DurMult) / magicEffect->mData.mBaseCost; + float magnitude = (magicEffect->mData.mFlags & ESM::MagicEffect::NoMagnitude) ? + 1.0f : (x / fPotionT1MagMul) / magicEffect->mData.mBaseCost; + float duration = (magicEffect->mData.mFlags & ESM::MagicEffect::NoDuration) ? + 1.0f : (x / fPotionT1DurMult) / magicEffect->mData.mBaseCost; if (!(magicEffect->mData.mFlags & ESM::MagicEffect::NoMagnitude)) applyTools (magicEffect->mData.mFlags, magnitude); diff --git a/apps/openmw/mwphysics/physicssystem.cpp b/apps/openmw/mwphysics/physicssystem.cpp index 5e79e2a09..40805a4b1 100644 --- a/apps/openmw/mwphysics/physicssystem.cpp +++ b/apps/openmw/mwphysics/physicssystem.cpp @@ -230,13 +230,6 @@ namespace MWPhysics return direction - project(direction, planeNormal); } - static inline osg::Vec3f reflect(const osg::Vec3& velocity, const osg::Vec3f& normal) - { - return velocity - (normal * (normal * velocity)) * 2; - // ^ dot product - } - - public: static osg::Vec3f traceDown(const MWWorld::Ptr &ptr, const osg::Vec3f& position, Actor* actor, btCollisionWorld* collisionWorld, float maxHeight) { diff --git a/apps/openmw/mwphysics/physicssystem.hpp b/apps/openmw/mwphysics/physicssystem.hpp index 3312f10a0..81385d675 100644 --- a/apps/openmw/mwphysics/physicssystem.hpp +++ b/apps/openmw/mwphysics/physicssystem.hpp @@ -211,7 +211,7 @@ namespace MWPhysics float mTimeAccum; float mWaterHeight; - float mWaterEnabled; + bool mWaterEnabled; std::auto_ptr mWaterCollisionObject; std::auto_ptr mWaterCollisionShape; diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index ba4307c89..fe20ac437 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -1058,11 +1058,9 @@ namespace MWRender float timepassed = duration * state.mSpeedMult; while(state.mPlaying) { - float targetTime; - if (!state.shouldLoop()) { - targetTime = state.getTime() + timepassed; + float targetTime = state.getTime() + timepassed; if(textkey == textkeys.end() || textkey->first > targetTime) { if(mAccumCtrl && state.mTime == mAnimationTimePtr[0]->getTimePtr()) diff --git a/apps/openmw/mwworld/scene.cpp b/apps/openmw/mwworld/scene.cpp index e27c0b585..2467af646 100644 --- a/apps/openmw/mwworld/scene.cpp +++ b/apps/openmw/mwworld/scene.cpp @@ -538,13 +538,9 @@ namespace MWWorld std::cout << "Changing to interior\n"; // unload - int current = 0; CellStoreCollection::iterator active = mActiveCells.begin(); while (active!=mActiveCells.end()) - { unloadCell (active++); - ++current; - } int refsToLoad = cell->count(); loadingListener->setProgressRange(refsToLoad);