From 65539d91787bf2b122f833781fed8b6aa9bc13cd Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Mon, 11 Jun 2007 14:27:48 +0000 Subject: Fixed a bug that prevented being-controlled particles from being deleted (thanks to tuchs for reporting). --- src/being.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/being.cpp') diff --git a/src/being.cpp b/src/being.cpp index 45032f6f..0ddceb0f 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -391,10 +391,19 @@ Being::logic() //Update particle effects for ( std::list::iterator i = mChildParticleEffects.begin(); - i != mChildParticleEffects.end(); - i++) + i != mChildParticleEffects.end(); + + ) { (*i)->setPosition((float)mPx + 16.0f, (float)mPy + 32.0f); + if (!(*i)->isAlive()) + { + (*i)->kill(); + i = mChildParticleEffects.erase(i); + } + else { + i++; + } } } -- cgit v1.2.3-60-g2f50