Changeset 12716

Timestamp:
Sep 28, 2012, 9:16:32 PM (12 years ago)
Author:
ben
Message:

Fixes missing Atlas selection rings for decorative actors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/source/simulation2/components/CCmpSelectable.cpp

    r12241 r12716  
    533533        if (!m_Cached)
    534534        {
    535             // Try to initialize m_Color to the owning player's colour.
    536             CmpPtr<ICmpPlayerManager> cmpPlayerManager(GetSimContext(), SYSTEM_ENTITY);
    537             if (!cmpPlayerManager)
    538                 return;
    539    
     535            // Default to white if there's no owner (e.g. decorative, editor-only actors)
     536            CColor color = CColor(1.0, 1.0, 1.0, 1.0);
    540537            CmpPtr<ICmpOwnership> cmpOwnership(GetSimContext(), GetEntityId());
    541             if (!cmpOwnership)
    542                 return;
    543    
    544             player_id_t owner = cmpOwnership->GetOwner();
    545             if (owner == INVALID_PLAYER)
    546                 return;
    547    
    548             CmpPtr<ICmpPlayer> cmpPlayer(GetSimContext(), cmpPlayerManager->GetPlayerByID(owner));
    549             if (!cmpPlayer)
    550                 return;
    551 
    552             CColor color = cmpPlayer->GetColour();
     538            if (cmpOwnership)
     539            {
     540                player_id_t owner = cmpOwnership->GetOwner();
     541                if (owner == INVALID_PLAYER)
     542                    return;
     543
     544                // Try to initialize m_Color to the owning player's colour.
     545                CmpPtr<ICmpPlayerManager> cmpPlayerManager(GetSimContext(), SYSTEM_ENTITY);
     546                if (!cmpPlayerManager)
     547                    return;
     548
     549                CmpPtr<ICmpPlayer> cmpPlayer(GetSimContext(), cmpPlayerManager->GetPlayerByID(owner));
     550                if (!cmpPlayer)
     551                    return;
     552
     553                color = cmpPlayer->GetColour();
     554            }
    553555            color.a = m_FadeBaselineAlpha + m_FadeDeltaAlpha;
    554556
Note: See TracChangeset for help on using the changeset viewer.