1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-06 00:55:50 +00:00

Rearranged check for better performance

This commit is contained in:
scrawl 2017-02-10 06:48:03 +01:00
parent 8752ae9c6a
commit 332ceb51a2

View File

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