summaryrefslogtreecommitdiff
path: root/src/particle.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-14 01:46:13 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-14 01:52:42 +0300
commitc0a5fffb45f849e224750f27fa8c3be5ac447ad6 (patch)
tree1fcac5e9836e119970acae9c5702ac83f40a935f /src/particle.cpp
parent1c62988a9e7ed1038250a2d044889eda046500c5 (diff)
downloadplus-c0a5fffb45f849e224750f27fa8c3be5ac447ad6.tar.gz
plus-c0a5fffb45f849e224750f27fa8c3be5ac447ad6.tar.bz2
plus-c0a5fffb45f849e224750f27fa8c3be5ac447ad6.tar.xz
plus-c0a5fffb45f849e224750f27fa8c3be5ac447ad6.zip
Add more checks.
Fix error in event.cpp from last commits. Improve party members sorting.
Diffstat (limited to 'src/particle.cpp')
-rw-r--r--src/particle.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/particle.cpp b/src/particle.cpp
index 7d7a73e9a..874e49d9a 100644
--- a/src/particle.cpp
+++ b/src/particle.cpp
@@ -95,6 +95,8 @@ void Particle::setupEngine()
Particle::maxCount = config.getIntValue("particleMaxCount");
Particle::fastPhysics = config.getIntValue("particleFastPhysics");
Particle::emitterSkip = config.getIntValue("particleEmitterSkip") + 1;
+ if (!Particle::emitterSkip)
+ Particle::emitterSkip = 1;
Particle::enabled = config.getBoolValue("particleeffects");
disableAutoDelete();
logger->log1("Particle engine set up");
@@ -200,11 +202,11 @@ bool Particle::update()
// Update child emitters
if ((mLifetimePast - 1) % Particle::emitterSkip == 0)
{
- for (EmitterIterator e = mChildEmitters.begin();
+ for (EmitterConstIterator e = mChildEmitters.begin();
e != mChildEmitters.end(); ++e)
{
Particles newParticles = (*e)->createParticles(mLifetimePast);
- for (ParticleIterator p = newParticles.begin();
+ for (ParticleConstIterator p = newParticles.begin();
p != newParticles.end(); ++p)
{
(*p)->moveBy(mPos);
@@ -258,7 +260,7 @@ bool Particle::update()
void Particle::moveBy(const Vector &change)
{
mPos += change;
- for (ParticleIterator p = mChildParticles.begin();
+ for (ParticleConstIterator p = mChildParticles.begin();
p != mChildParticles.end(); ++p)
{
if ((*p)->doesFollow())
@@ -451,7 +453,7 @@ void Particle::adjustEmitterSize(int w, int h)
{
if (mAllowSizeAdjust)
{
- for (EmitterIterator e = mChildEmitters.begin();
+ for (EmitterConstIterator e = mChildEmitters.begin();
e != mChildEmitters.end(); ++e)
{
(*e)->adjustSize(w, h);