mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-27 06:55:54 -04:00
Fix invisibility/chameleon alpha (thanks Hrnchamd)
This commit is contained in:
parent
19dc01232c
commit
9dfee1dfe2
@ -2675,14 +2675,14 @@ void CharacterController::setVisibility(float visibility)
|
||||
if (mPtr.getClass().getCreatureStats(mPtr).getMagicEffects().get(ESM::MagicEffect::Invisibility).getModifier()) // Ignore base magnitude (see bug #3555).
|
||||
{
|
||||
if (mPtr == getPlayer())
|
||||
alpha = 0.4f;
|
||||
alpha = 0.25f;
|
||||
else
|
||||
alpha = 0.f;
|
||||
alpha = 0.05f;
|
||||
}
|
||||
float chameleon = mPtr.getClass().getCreatureStats(mPtr).getMagicEffects().get(ESM::MagicEffect::Chameleon).getMagnitude();
|
||||
if (chameleon)
|
||||
{
|
||||
alpha *= std::max(0.2f, (100.f - chameleon)/100.f);
|
||||
alpha *= std::min(0.75f, std::max(0.25f, (100.f - chameleon)/100.f));
|
||||
}
|
||||
|
||||
visibility = std::min(visibility, alpha);
|
||||
|
Loading…
x
Reference in New Issue
Block a user