Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/components/CCmpRallyPointRenderer.cpp
Show First 20 Lines • Show All 267 Lines • ▼ Show 20 Lines | for (size_t i = 0; i < m_RallyPoints.size(); ++i) | ||||
m_LastOwner = ownerId; | m_LastOwner = ownerId; | ||||
CmpPtr<ICmpPlayerManager> cmpPlayerManager(GetSystemEntity()); | CmpPtr<ICmpPlayerManager> cmpPlayerManager(GetSystemEntity()); | ||||
// cmpPlayerManager should not be null as long as this method is called on-demand instead of at Init() time | // cmpPlayerManager should not be null as long as this method is called on-demand instead of at Init() time | ||||
// (we can't rely on component initialization order in Init()) | // (we can't rely on component initialization order in Init()) | ||||
if (!cmpPlayerManager) | if (!cmpPlayerManager) | ||||
continue; | continue; | ||||
CmpPtr<ICmpIdentity> cmpIdentity(GetSimContext(), cmpPlayerManager->GetPlayerByID(ownerId)); | CmpPtr<ICmpPlayer> cmpPlayer(GetSimContext(), cmpPlayerManager->GetPlayerByID(ownerId)); | ||||
if (!cmpIdentity) | if (!cmpPlayer) | ||||
continue; | continue; | ||||
CmpPtr<ICmpVisual> cmpVisualActor(GetSimContext(), m_MarkerEntityIds[i]); | CmpPtr<ICmpVisual> cmpVisualActor(GetSimContext(), m_MarkerEntityIds[i]); | ||||
if (cmpVisualActor) | if (cmpVisualActor) | ||||
cmpVisualActor->SetVariant("civ", CStrW(cmpIdentity->GetCiv()).ToUTF8()); | cmpVisualActor->SetVariant("civ", CStrW(cmpPlayer->GetCiv()).ToUTF8()); | ||||
} | } | ||||
m_LastMarkerCount = m_RallyPoints.size() - 1; | m_LastMarkerCount = m_RallyPoints.size() - 1; | ||||
} | } | ||||
void CCmpRallyPointRenderer::UpdateLineColor() | void CCmpRallyPointRenderer::UpdateLineColor() | ||||
{ | { | ||||
CmpPtr<ICmpOwnership> cmpOwnership(GetEntityHandle()); | CmpPtr<ICmpOwnership> cmpOwnership(GetEntityHandle()); | ||||
if (!cmpOwnership) | if (!cmpOwnership) | ||||
▲ Show 20 Lines • Show All 751 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator