forked from teamnwah/openmw-tes3coop
Spell priority: make AI do not cast target spells when enemy is under water
This commit is contained in:
parent
3190f28710
commit
9fdfb2a83f
1 changed files with 7 additions and 1 deletions
|
@ -549,7 +549,13 @@ namespace MWMechanics
|
||||||
if (effect.mRange == ESM::RT_Target)
|
if (effect.mRange == ESM::RT_Target)
|
||||||
{
|
{
|
||||||
if (MWBase::Environment::get().getWorld()->isUnderwater(MWWorld::ConstPtr(actor), 0.75f))
|
if (MWBase::Environment::get().getWorld()->isUnderwater(MWWorld::ConstPtr(actor), 0.75f))
|
||||||
return 0;
|
return 0.f;
|
||||||
|
|
||||||
|
if (enemy.isEmpty())
|
||||||
|
return 0.f;
|
||||||
|
|
||||||
|
if (MWBase::Environment::get().getWorld()->isUnderwater(MWWorld::ConstPtr(enemy), 0.75f))
|
||||||
|
return 0.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
rating *= magicEffect->mData.mBaseCost;
|
rating *= magicEffect->mData.mBaseCost;
|
||||||
|
|
Loading…
Reference in a new issue