Created
January 20, 2013 20:40
-
-
Save PilzAdam/4581577 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/particles.cpp b/src/particles.cpp | |
index d49e333..9ca4aef 100644 | |
--- a/src/particles.cpp | |
+++ b/src/particles.cpp | |
@@ -125,12 +125,16 @@ void Particle::step(float dtime, ClientEnvironment &env) | |
v3f p_pos = m_pos*BS; | |
v3f p_velocity = m_velocity*BS; | |
v3f p_acceleration = m_acceleration*BS; | |
- collisionMoveSimple(&env.getClientMap(), m_gamedef, | |
+ collisionMoveResult result = collisionMoveSimple(&env.getClientMap(), | |
+ m_gamedef, | |
BS*0.5, box, | |
0, dtime, | |
p_pos, p_velocity, p_acceleration); | |
m_pos = p_pos/BS; | |
- m_velocity = p_velocity/BS; | |
+ if(result.touching_ground) | |
+ m_velocity = v3f(0,0,0); | |
+ else | |
+ m_velocity = p_velocity/BS; | |
m_acceleration = p_acceleration/BS; | |
m_time += dtime; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment