]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
don't call ODE dWorldQuickStep with 0 step time
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 9 Nov 2011 19:39:40 +0000 (19:39 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 9 Nov 2011 19:39:40 +0000 (19:39 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11544 d7cf8633-e32d-0410-b094-e92efae38249

world.c

diff --git a/world.c b/world.c
index 43fc01ed94b511761e301c7873a7b297f00bf04b..1225090c626d57c03f04e42ecbfbf65f22495ccd 100644 (file)
--- a/world.c
+++ b/world.c
@@ -2672,8 +2672,10 @@ void World_Physics_Frame(world_t *world, double frametime, double gravity)
                        collisiontime += (Sys_DirtyTime() - tdelta3)*10000;
 
                        // run physics (move objects, calculate new velocities)
+                       // be sure not to pass 0 as step time because that causes an ODE error
                        dWorldSetQuickStepNumIterations((dWorldID)world->physics.ode_world, bound(1, physics_ode_worldstep_iterations.integer, 200));
-                       dWorldQuickStep((dWorldID)world->physics.ode_world, world->physics.ode_step);
+                       if (world->physics.ode_step > 0)
+                               dWorldQuickStep((dWorldID)world->physics.ode_world, world->physics.ode_step);
 
                        // clear the JointGroup now that we're done with it
                        dJointGroupEmpty((dJointGroupID)world->physics.ode_contactgroup);