Stop AiPursue when target has invisibility or chameleon>=75

moveref
scrawl 10 years ago
parent e5de253169
commit 019cd96719

@ -43,6 +43,10 @@ bool AiPursue::execute (const MWWorld::Ptr& actor, AiState& state, float duratio
) )
return true; //Target doesn't exist return true; //Target doesn't exist
if (target.getClass().getCreatureStats(target).getMagicEffects().get(ESM::MagicEffect::Invisibility).getMagnitude() > 0
|| target.getClass().getCreatureStats(target).getMagicEffects().get(ESM::MagicEffect::Chameleon).getMagnitude() > 75)
return true;
if(target.getClass().getCreatureStats(target).isDead()) if(target.getClass().getCreatureStats(target).isDead())
return true; return true;

Loading…
Cancel
Save