Skip to content

Commit

Permalink
Fix particle code ignoring return value of std::vector::erase(). Wat.
Browse files Browse the repository at this point in the history
  • Loading branch information
kahrl committed Dec 23, 2013
1 parent a58b47d commit a537725
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/particles.cpp
Expand Up @@ -221,7 +221,7 @@ void allparticles_step (float dtime, ClientEnvironment &env)
{
(*i)->remove();
delete *i;
all_particles.erase(i);
i = all_particles.erase(i);
}
else
{
Expand Down Expand Up @@ -375,7 +375,7 @@ void ParticleSpawner::step(float dtime, ClientEnvironment &env)
m_texture,
v2f(0.0, 0.0),
v2f(1.0, 1.0));
m_spawntimes.erase(i);
i = m_spawntimes.erase(i);
}
else
{
Expand Down Expand Up @@ -462,6 +462,6 @@ void clear_particles ()
{
(*i)->remove();
delete *i;
all_particles.erase(i);
}
i = all_particles.erase(i);
}
}

0 comments on commit a537725

Please sign in to comment.