mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-27 04:10:24 +00:00
Merge branch 'awareness' into 'master'
Fix invisibility handling in awareness checks See merge request OpenMW/openmw!2203
This commit is contained in:
commit
7361a1c6fd
1 changed files with 4 additions and 5 deletions
|
@ -1524,10 +1524,6 @@ namespace MWMechanics
|
||||||
|
|
||||||
CreatureStats& stats = ptr.getClass().getCreatureStats(ptr);
|
CreatureStats& stats = ptr.getClass().getCreatureStats(ptr);
|
||||||
|
|
||||||
float invisibility = stats.getMagicEffects().get(ESM::MagicEffect::Invisibility).getMagnitude();
|
|
||||||
if (invisibility > 0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
float sneakTerm = 0;
|
float sneakTerm = 0;
|
||||||
if (isSneaking(ptr))
|
if (isSneaking(ptr))
|
||||||
{
|
{
|
||||||
|
@ -1555,7 +1551,10 @@ namespace MWMechanics
|
||||||
float distTerm = fSneakDistBase + fSneakDistMult * (pos1 - pos2).length();
|
float distTerm = fSneakDistBase + fSneakDistMult * (pos1 - pos2).length();
|
||||||
|
|
||||||
float chameleon = stats.getMagicEffects().get(ESM::MagicEffect::Chameleon).getMagnitude();
|
float chameleon = stats.getMagicEffects().get(ESM::MagicEffect::Chameleon).getMagnitude();
|
||||||
float x = sneakTerm * distTerm * stats.getFatigueTerm() + chameleon + invisibility;
|
float invisibility = stats.getMagicEffects().get(ESM::MagicEffect::Invisibility).getMagnitude();
|
||||||
|
float x = sneakTerm * distTerm * stats.getFatigueTerm() + chameleon;
|
||||||
|
if (invisibility > 0.f)
|
||||||
|
x += 100.f;
|
||||||
|
|
||||||
CreatureStats& observerStats = observer.getClass().getCreatureStats(observer);
|
CreatureStats& observerStats = observer.getClass().getCreatureStats(observer);
|
||||||
float obsAgility = observerStats.getAttribute(ESM::Attribute::Agility).getModified();
|
float obsAgility = observerStats.getAttribute(ESM::Attribute::Agility).getModified();
|
||||||
|
|
Loading…
Reference in a new issue