Ticket #2627: 2627.2.diff
File 2627.2.diff, 1.3 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 … … 111 111 virtual void Init(const CParamNode& paramNode) 112 112 { 113 113 m_EditorOnly = paramNode.GetChild("EditorOnly").IsOk(); 114 CmpPtr<ICmpPosition> cmpPosition(GetEntityHandle()); 114 115 115 116 // Certain special units always have their selection overlay shown 116 117 m_AlwaysVisible = paramNode.GetChild("Overlay").GetChild("AlwaysVisible").IsOk(); 117 if ( m_AlwaysVisible)118 if ((!cmpPosition || cmpPosition->IsInWorld()) && m_AlwaysVisible) 118 119 { 119 120 m_AlphaMin = MIN_ALPHA_ALWAYS_VISIBLE; 120 121 m_Color.a = m_AlphaMin; … … 172 173 m_Color.r = color.r; 173 174 m_Color.g = color.g; 174 175 m_Color.b = color.b; 176 CmpPtr<ICmpPosition> cmpPosition(GetEntityHandle()); 175 177 176 178 // Always-visible overlays will be desaturated if their parent unit is deselected. 177 if ( m_AlwaysVisible && !selected)179 if ((!cmpPosition || cmpPosition->IsInWorld()) && m_AlwaysVisible && !selected) 178 180 { 179 181 float max; 180 182