mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-19 16:21:08 +00:00
Merge pull request #1259 from Allofich/warnings
Fix a few Cppcheck warnings
This commit is contained in:
commit
df3b4fe6a5
@ -500,7 +500,6 @@ namespace MWMechanics
|
||||
{
|
||||
// get the range of the target's weapon
|
||||
float rangeAttackOfTarget = 0.f;
|
||||
bool isRangedCombat = false;
|
||||
MWWorld::Ptr targetWeapon = MWWorld::Ptr();
|
||||
const MWWorld::Class& targetClass = target.getClass();
|
||||
|
||||
@ -516,7 +515,10 @@ namespace MWMechanics
|
||||
boost::shared_ptr<Action> 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
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -211,7 +211,7 @@ namespace MWPhysics
|
||||
float mTimeAccum;
|
||||
|
||||
float mWaterHeight;
|
||||
float mWaterEnabled;
|
||||
bool mWaterEnabled;
|
||||
|
||||
std::auto_ptr<btCollisionObject> mWaterCollisionObject;
|
||||
std::auto_ptr<btCollisionShape> mWaterCollisionShape;
|
||||
|
@ -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())
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user