Ticket #2627: 2627.4.patch

File 2627.4.patch, 1.6 KB (added by Stan, 9 years ago)

Another One, without handle.

  • simulation2/components/CCmpSelectable.cpp

     
    1 /* Copyright (C) 2012 Wildfire Games.
     1/* Copyright (C) 2015 Wildfire Games.
    22 * This file is part of 0 A.D.
    33 *
    44 * 0 A.D. is free software: you can redistribute it and/or modify
     
    114114
    115115        // Certain special units always have their selection overlay shown
    116116        m_AlwaysVisible = paramNode.GetChild("Overlay").GetChild("AlwaysVisible").IsOk();
    117         if (m_AlwaysVisible)
     117        if (m_IsInWorld && m_AlwaysVisible)
    118118        {
    119119            m_AlphaMin = MIN_ALPHA_ALWAYS_VISIBLE;
    120120            m_Color.a = m_AlphaMin;
     
    174174        m_Color.b = color.b;
    175175
    176176        // Always-visible overlays will be desaturated if their parent unit is deselected.
    177         if (m_AlwaysVisible && !selected)
     177        if (m_IsInWorld && m_AlwaysVisible && !selected)
    178178        {
    179179            float max;
    180180
     
    262262    bool m_AlwaysVisible;
    263263    /// Whether the parent entity is selected (caches GUI's selection state).
    264264    bool m_Selected;
     265    /// Whether the entity is in world.
     266    bool m_IsInWorld;
    265267    /// Current selection overlay color. Alpha component is subject to fading.
    266268    CColor m_Color;
    267269    /// Whether the selectable's player colour has been cached for rendering.
     
    345347            break;
    346348        }
    347349    case MT_PositionChanged:
     350    {
     351        const CMessagePositionChanged& data = static_cast<const CMessagePositionChanged&> (msg);
     352
     353        m_IsInWorld = data.inWorld;
     354    }
    348355    case MT_TerrainChanged:
    349356    case MT_WaterChanged:
    350357        {