summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/bg_pmove.c4
1 files changed, 3 insertions, 1 deletions
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 );