mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-10 12:39:53 +00:00
Reduce scope of variables
This commit is contained in:
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…
x
Reference in New Issue
Block a user