From 2527aabd5dc98c2225469d7b74d72dc8863f5ef1 Mon Sep 17 00:00:00 2001 From: Itms Date: Sun, 4 Jun 2017 13:04:04 +0000 Subject: [PATCH] Fix hero selection rings becoming unsaturated when moving. Patch by Sandarac, refs 0a53c5e06a, #2627. Differential Revision: https://code.wildfiregames.com/D563 This was SVN commit r19732. --- source/simulation2/components/CCmpSelectable.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/source/simulation2/components/CCmpSelectable.cpp b/source/simulation2/components/CCmpSelectable.cpp index 2fb13240bc..982b07e036 100644 --- a/source/simulation2/components/CCmpSelectable.cpp +++ b/source/simulation2/components/CCmpSelectable.cpp @@ -381,12 +381,14 @@ void CCmpSelectable::HandleMessage(const CMessage& msg, bool UNUSED(global)) } case MT_PositionChanged: { - if (m_AlwaysVisible) - { - const CMessagePositionChanged& msgData = static_cast (msg); - m_AlphaMin = msgData.inWorld ? MIN_ALPHA_ALWAYS_VISIBLE : MIN_ALPHA_UNSELECTED; - m_Color.a = m_AlphaMin; - } + if (!m_AlwaysVisible) + break; + + const CMessagePositionChanged& msgData = static_cast (msg); + if (msgData.inWorld && !m_Selected) + m_Color.a = m_AlphaMin = MIN_ALPHA_ALWAYS_VISIBLE; + else if (!msgData.inWorld) + m_Color.a = m_AlphaMin = MIN_ALPHA_UNSELECTED; InvalidateStaticOverlay(); break;