diff --git a/src/game/shared/movement/pm_shared.cpp b/src/game/shared/movement/pm_shared.cpp index a6e1c29f..851baa17 100644 --- a/src/game/shared/movement/pm_shared.cpp +++ b/src/game/shared/movement/pm_shared.cpp @@ -966,6 +966,16 @@ int PM_ClipVelocity(Vector &in, Vector &normal, Vector &out, float overbounce) out[i] = 0; } + // iterate once to make sure we aren't still moving through the plane + float adjust = DotProduct(out, normal); + if (adjust <= 0.0f) + { + // min this against a small number (but no further from zero than -DIST_EPSILON) to account for crossing a plane with a near-parallel normal + adjust = min(adjust, -DIST_EPSILON); + for (i=0 ; i<3 ; i++) + out[i] -= normal[i]*adjust; + } + // Return blocking flags. return blocked; }