Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
ashdnazg committed Jun 20, 2015
1 parent 820fefa commit 8fef450
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rts/Rendering/Models/WorldObjectModelRenderer.cpp
Expand Up @@ -104,7 +104,7 @@ void IWorldObjectModelRenderer::DelUnit(const CUnit* u)
{
UnitSet& us = units[TEX_TYPE(u)];

// Unit can still be in the container, since we can't know in UnitDrawer.cpp
// Unit can be absent from the container, since we can't know in UnitDrawer.cpp
// whether it's cloaked or not.

auto it = std::find(us.begin(), us.end(), const_cast<CUnit*>(u));
Expand Down Expand Up @@ -177,9 +177,10 @@ void IWorldObjectModelRenderer::AddProjectile(const CProjectile* p)
void IWorldObjectModelRenderer::DelProjectile(const CProjectile* p)
{
ProjectileSet &ps = projectiles[TEX_TYPE(p)];
assert(std::find(ps.begin(), ps.end(), const_cast<CProjectile*>(p)) != ps.end());

auto it = std::find(ps.begin(), ps.end(), const_cast<CProjectile*>(p));
assert(it != ps.end());

*it = ps.back();
ps.pop_back();
numProjectiles -= 1;
Expand Down

0 comments on commit 8fef450

Please sign in to comment.