Ticket #2627: 2627.4.patch
File 2627.4.patch, 1.6 KB (added by , 9 years ago) |
---|
-
simulation2/components/CCmpSelectable.cpp
1 /* Copyright (C) 201 2Wildfire Games.1 /* Copyright (C) 2015 Wildfire Games. 2 2 * This file is part of 0 A.D. 3 3 * 4 4 * 0 A.D. is free software: you can redistribute it and/or modify … … 114 114 115 115 // Certain special units always have their selection overlay shown 116 116 m_AlwaysVisible = paramNode.GetChild("Overlay").GetChild("AlwaysVisible").IsOk(); 117 if (m_ AlwaysVisible)117 if (m_IsInWorld && m_AlwaysVisible) 118 118 { 119 119 m_AlphaMin = MIN_ALPHA_ALWAYS_VISIBLE; 120 120 m_Color.a = m_AlphaMin; … … 174 174 m_Color.b = color.b; 175 175 176 176 // Always-visible overlays will be desaturated if their parent unit is deselected. 177 if (m_ AlwaysVisible && !selected)177 if (m_IsInWorld && m_AlwaysVisible && !selected) 178 178 { 179 179 float max; 180 180 … … 262 262 bool m_AlwaysVisible; 263 263 /// Whether the parent entity is selected (caches GUI's selection state). 264 264 bool m_Selected; 265 /// Whether the entity is in world. 266 bool m_IsInWorld; 265 267 /// Current selection overlay color. Alpha component is subject to fading. 266 268 CColor m_Color; 267 269 /// Whether the selectable's player colour has been cached for rendering. … … 345 347 break; 346 348 } 347 349 case MT_PositionChanged: 350 { 351 const CMessagePositionChanged& data = static_cast<const CMessagePositionChanged&> (msg); 352 353 m_IsInWorld = data.inWorld; 354 } 348 355 case MT_TerrainChanged: 349 356 case MT_WaterChanged: 350 357 {