From 1de4cbbf14919125d9e29e9cecb843aeb9c6daf6 Mon Sep 17 00:00:00 2001
From: havoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Wed, 9 Nov 2011 19:39:40 +0000
Subject: [PATCH] don't call ODE dWorldQuickStep with 0 step time

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11544 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=84aa1c7f53ee811b5061c5d703c3c15927e3b30d
---
 world.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/world.c b/world.c
index 27351c89..04b956b9 100644
--- 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);
-- 
2.39.5