]> git.lizzy.rs Git - minetest.git/blobdiff - src/particles.cpp
Don't pass non-const references to collision methods
[minetest.git] / src / particles.cpp
index ab48bae9e3c0b4c4a2cf39c639bb970173fbffa8..8150e19acb90e92a20aad3c7713813f53fe160fa 100644 (file)
@@ -131,14 +131,12 @@ void Particle::step(float dtime)
                core::aabbox3d<f32> box = m_collisionbox;
                v3f p_pos = m_pos*BS;
                v3f p_velocity = m_velocity*BS;
-               v3f p_acceleration = m_acceleration*BS;
                collisionMoveSimple(m_env, m_gamedef,
                        BS*0.5, box,
                        0, dtime,
-                       p_pos, p_velocity, p_acceleration);
+                       &p_pos, &p_velocity, m_acceleration * BS);
                m_pos = p_pos/BS;
                m_velocity = p_velocity/BS;
-               m_acceleration = p_acceleration/BS;
        }
        else
        {
@@ -288,7 +286,7 @@ void ParticleSpawner::step(float dtime, ClientEnvironment* env)
                        }
                        else
                        {
-                               i++;
+                               ++i;
                        }
                }
        }
@@ -360,7 +358,7 @@ void ParticleManager::stepSpawners (float dtime)
                else
                {
                        i->second->step(dtime, m_env);
-                       i++;
+                       ++i;
                }
        }
 }
@@ -380,7 +378,7 @@ void ParticleManager::stepParticles (float dtime)
                else
                {
                        (*i)->step(dtime);
-                       i++;
+                       ++i;
                }
        }
 }