Style cleanup, and remove a wrong TODO.
This was SVN commit r16974.
This commit is contained in:
parent
0c4c6e499d
commit
8dde1cda94
@ -599,9 +599,6 @@ public:
|
||||
|
||||
virtual std::vector<entity_id_t> GetEntityCollisions(bool checkStructures, bool checkUnits)
|
||||
{
|
||||
// TODO: That function actually only checks for overlapping units when a new buidling is started.
|
||||
// The name of the function should be changed and useless code removed.
|
||||
|
||||
std::vector<entity_id_t> ret;
|
||||
|
||||
CmpPtr<ICmpObstructionManager> cmpObstructionManager(GetSystemEntity());
|
||||
|
@ -984,7 +984,7 @@ void CCmpObstructionManager::GetUnitsOnObstruction(const ObstructionSquare& squa
|
||||
|
||||
std::map<entity_pos_t, SimRasterize::Spans> rasterizedRects;
|
||||
|
||||
for (entity_id_t& unitShape : unitShapes)
|
||||
for (const u32& unitShape : unitShapes)
|
||||
{
|
||||
auto it = m_UnitShapes.find(unitShape);
|
||||
ENSURE(it != m_UnitShapes.end());
|
||||
@ -1008,10 +1008,13 @@ void CCmpObstructionManager::GetUnitsOnObstruction(const ObstructionSquare& squa
|
||||
u16 i = (shape.x / Pathfinding::NAVCELL_SIZE).ToInt_RoundToNegInfinity();
|
||||
u16 j = (shape.z / Pathfinding::NAVCELL_SIZE).ToInt_RoundToNegInfinity();
|
||||
|
||||
for (size_t k = 0; k < spans.size(); ++k)
|
||||
for (const SimRasterize::Span& span : spans)
|
||||
{
|
||||
if (j == spans[k].j && spans[k].i0 <= i && i < spans[k].i1)
|
||||
if (j == span.j && span.i0 <= i && i < span.i1)
|
||||
{
|
||||
out.push_back(shape.entity);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user