1
0
forked from 0ad/0ad

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.
This commit is contained in:
Nicolas Auvray 2017-06-04 13:04:04 +00:00
parent a63d7cc430
commit 2527aabd5d

View File

@ -381,12 +381,14 @@ void CCmpSelectable::HandleMessage(const CMessage& msg, bool UNUSED(global))
}
case MT_PositionChanged:
{
if (m_AlwaysVisible)
{
if (!m_AlwaysVisible)
break;
const CMessagePositionChanged& msgData = static_cast<const CMessagePositionChanged&> (msg);
m_AlphaMin = msgData.inWorld ? MIN_ALPHA_ALWAYS_VISIBLE : MIN_ALPHA_UNSELECTED;
m_Color.a = m_AlphaMin;
}
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;