From 9dfee1dfe20918e56bfed34311556c4d889e1a6d Mon Sep 17 00:00:00 2001 From: Alexei Dobrohotov Date: Sun, 30 Jun 2019 16:13:11 +0300 Subject: [PATCH] Fix invisibility/chameleon alpha (thanks Hrnchamd) --- apps/openmw/mwmechanics/character.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 03382a8887..7966526f2e 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -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);