Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/helpers/Selection.cpp
Context not available. | ||||||||||
} | } | |||||||||
else // owner == INVALID_PLAYER; Used when selecting units in Atlas or other mods that allow all kinds of selectables to be selected. | else // owner == INVALID_PLAYER; Used when selecting units in Atlas or other mods that allow all kinds of selectables to be selected. | |||||||||
{ | { | |||||||||
const CSimulation2::InterfaceListUnordered& selectableEnts = simulation.GetEntitiesWithInterfaceUnordered(IID_Selectable); | SComponentDataGenerator* selectableEnts = simulation.GetEntitiesWithInterfaceUnordered(IID_Selectable); | |||||||||
for (CSimulation2::InterfaceListUnordered::const_iterator it = selectableEnts.begin(); it != selectableEnts.end(); ++it) | while(IComponent* cmp = selectableEnts->Next()) | |||||||||
{ | { | |||||||||
if (CheckEntityVisibleAndInRect(it->second->GetEntityHandle(), cmpRangeManager, camera, sx0, sy0, sx1, sy1, owner, allowEditorSelectables)) | if (CheckEntityVisibleAndInRect(cmp->GetEntityHandle(), cmpRangeManager, camera, sx0, sy0, sx1, sy1, owner, allowEditorSelectables)) | |||||||||
hitEnts.push_back(it->first); | hitEnts.push_back(cmp->GetEntityId()); | |||||||||
} | } | |||||||||
} | } | |||||||||
Context not available. | ||||||||||
std::vector<entity_id_t> hitEnts; | std::vector<entity_id_t> hitEnts; | |||||||||
const CSimulation2::InterfaceListUnordered& ents = simulation.GetEntitiesWithInterfaceUnordered(IID_Selectable); | SComponentDataGenerator* ents = simulation.GetEntitiesWithInterfaceUnordered(IID_Selectable); | |||||||||
for (CSimulation2::InterfaceListUnordered::const_iterator it = ents.begin(); it != ents.end(); ++it) | while(IComponent* cmp = ents->Next()) | |||||||||
StanUnsubmitted Done Inline Actions
Stan: | ||||||||||
{ | { | |||||||||
entity_id_t ent = it->first; | CEntityHandle handle = cmp->GetEntityHandle(); | |||||||||
Done Inline ActionsDon't need those two before the if I suppose. Stan: Don't need those two before the if I suppose. | ||||||||||
CEntityHandle handle = it->second->GetEntityHandle(); | entity_id_t ent = handle.GetId(); | |||||||||
// Check if this entity is only selectable in Atlas | // Check if this entity is only selectable in Atlas | |||||||||
if (static_cast<ICmpSelectable*>(it->second)->IsEditorOnly() && !allowEditorSelectables) | if (static_cast<ICmpSelectable*>(cmp)->IsEditorOnly() && !allowEditorSelectables) | |||||||||
continue; | continue; | |||||||||
if (matchRank) | if (matchRank) | |||||||||
Context not available. |
Wildfire Games · Phabricator