Reduce scope of variables

This commit is contained in:
Allofich 2017-04-20 00:35:27 +09:00
parent c655875584
commit 5a00b239ac
2 changed files with 5 additions and 5 deletions

View file

@ -500,7 +500,6 @@ namespace MWMechanics
{ {
// get the range of the target's weapon // get the range of the target's weapon
float rangeAttackOfTarget = 0.f; float rangeAttackOfTarget = 0.f;
bool isRangedCombat = false;
MWWorld::Ptr targetWeapon = MWWorld::Ptr(); MWWorld::Ptr targetWeapon = MWWorld::Ptr();
const MWWorld::Class& targetClass = target.getClass(); const MWWorld::Class& targetClass = target.getClass();
@ -516,7 +515,10 @@ namespace MWMechanics
boost::shared_ptr<Action> targetWeaponAction (new ActionWeapon(targetWeapon)); boost::shared_ptr<Action> targetWeaponAction (new ActionWeapon(targetWeapon));
if (targetWeaponAction.get()) if (targetWeaponAction.get())
{
bool isRangedCombat = false;
rangeAttackOfTarget = targetWeaponAction->getCombatRange(isRangedCombat); rangeAttackOfTarget = targetWeaponAction->getCombatRange(isRangedCombat);
}
// apply sideway movement (kind of dodging) with some probability // apply sideway movement (kind of dodging) with some probability
// if actor is within range of target's weapon // if actor is within range of target's weapon

View file

@ -1058,11 +1058,9 @@ namespace MWRender
float timepassed = duration * state.mSpeedMult; float timepassed = duration * state.mSpeedMult;
while(state.mPlaying) while(state.mPlaying)
{ {
float targetTime;
if (!state.shouldLoop()) if (!state.shouldLoop())
{ {
targetTime = state.getTime() + timepassed; float targetTime = state.getTime() + timepassed;
if(textkey == textkeys.end() || textkey->first > targetTime) if(textkey == textkeys.end() || textkey->first > targetTime)
{ {
if(mAccumCtrl && state.mTime == mAnimationTimePtr[0]->getTimePtr()) if(mAccumCtrl && state.mTime == mAnimationTimePtr[0]->getTimePtr())