mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-23 11:42:38 +00:00
Rearranged check for better performance
This commit is contained in:
parent
8752ae9c6a
commit
332ceb51a2
@ -300,6 +300,10 @@ namespace MWMechanics
|
|||||||
if (!actor1.getClass().isMobile(actor1))
|
if (!actor1.getClass().isMobile(actor1))
|
||||||
return;
|
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
|
// 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;
|
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
|
// Do aggression check if actor2 is the player or a player follower or escorter
|
||||||
if (!aggressive)
|
if (!aggressive)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user