Reduce scope of variables

0.6.1
Allofich 8 years ago
parent c655875584
commit 5a00b239ac

@ -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<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

@ -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())

Loading…
Cancel
Save