]> 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)
committerRudolf Polzer <divverent@xonotic.org>
Thu, 10 Nov 2011 20:25:38 +0000 (21:25 +0100)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11544 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=84aa1c7f53ee811b5061c5d703c3c15927e3b30d

world.c

diff --git a/world.c b/world.c
index 27351c892cfd6bb507c733cee2cf0b0442c938eb..04b956b971ead6558663550c5646515004cf4882 100644 (file)
--- a/world.c
+++ b/world.c
@@ -2667,8 +2667,10 @@ void World_Physics_Frame(world_t *world, double frametime, double gravity)
                        collisiontime += (Sys_DoubleTime() - 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);