From 79c4a4da68b6de0f8e58eb7191b18bf35402c2f6 Mon Sep 17 00:00:00 2001 From: Christopher Schwarz Date: Sun, 23 Jan 2011 21:50:43 +0000 Subject: * Fix the "light bug" where wallwalking over small bumps on the ceiling (such as lights) could cause you to invert. Special thanks to PhilH, Odin, Roman Tetelman, Timbo, Khalsa, and Lava_Croft for help in nailing it down and/or trying to help me do so. --- src/game/bg_pmove.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/game') diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 0c29d55d..b1bccec2 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -2139,7 +2139,9 @@ static void PM_GroundClimbTrace( void ) pm->ps->eFlags |= EF_WALLCLIMB; //if we're not stuck to the ceiling then set grapplePoint to be a surface normal - if( !VectorCompare( trace.plane.normal, ceilingNormal ) ) + //use VectorCompareEpsilon here to prevent a bug where differences in fp precision + //lead to taking crossproducts that give all-zero normals + if( !VectorCompareEpsilon( trace.plane.normal, ceilingNormal, .000001f ) ) { //so we know what surface we're stuck to VectorCopy( trace.plane.normal, pm->ps->grapplePoint ); -- cgit