Rearranged check for better performance

coverity_scan^2
scrawl 8 years ago
parent 8752ae9c6a
commit 332ceb51a2

@ -300,6 +300,10 @@ namespace MWMechanics
if (!actor1.getClass().isMobile(actor1))
return;
// Stop here if target is unreachable
if (!MWMechanics::canFight(actor1, actor2))
return;
// If this is set to true, actor1 will start combat with actor2 if the awareness check at the end of the method returns true
bool aggressive = false;
@ -375,10 +379,6 @@ namespace MWMechanics
}
}
// Stop here if target is unreachable
if (!MWMechanics::canFight(actor1, actor2))
return;
// Do aggression check if actor2 is the player or a player follower or escorter
if (!aggressive)
{

Loading…
Cancel
Save