This patch lets you wallwalk on buildables and players:
Index: src/game/bg_pmove.c
===================================================================
--- src/game/bg_pmove.c (revision 93)
+++ src/game/bg_pmove.c (working copy)
@@ -1831,7 +1831,7 @@
//used for delta correction
vec3_t traceCROSSsurf, traceCROSSref, surfCROSSref;
float traceDOTsurf, traceDOTref, surfDOTref, rTtDOTrTsTt;
- float traceANGsurf, traceANGref, surfANGref;
+ float traceANGref, surfANGref;
vec3_t horizontal = { 1.0f, 0.0f, 0.0f }; //arbituary vector perpendicular to refNormal
vec3_t refTOtrace, refTOsurfTOtrace, tempVec;
int rTtANGrTsTt;
@@ -1908,10 +1908,9 @@
pm->trace( &trace, pm->ps->origin, pm->mins, pm->maxs, point, pm->ps->clientNum, pm->tracemask );
break;
}
-
+
//if we hit something
- if( trace.fraction < 1.0f && !( trace.surfaceFlags & ( SURF_SKY | SURF_SLICK ) ) &&
- !( trace.entityNum != ENTITYNUM_WORLD && i != 4 ) )
+ if( trace.fraction < 1.0f && !( trace.surfaceFlags & ( SURF_SKY | SURF_SLICK ) ) )
{
if( i == 2 || i == 3 )
{
@@ -1933,11 +1932,7 @@
//calculate angle between surf and trace
traceDOTsurf = DotProduct( trace.plane.normal, surfNormal );
- traceANGsurf = RAD2DEG( acos( traceDOTsurf ) );
- if( traceANGsurf > 180.0f )
- traceANGsurf -= 180.0f;
-
//calculate angle between trace and ref
traceDOTref = DotProduct( trace.plane.normal, refNormal );
traceANGref = RAD2DEG( acos( traceDOTref ) );
@@ -1968,7 +1963,6 @@
//calculate reference rotated through to surf plane then to trace plane
RotatePointAroundVector( tempVec, surfCROSSref, horizontal, -surfANGref );
- RotatePointAroundVector( refTOsurfTOtrace, traceCROSSsurf, tempVec, -traceANGsurf );
//calculate angle between refTOtrace and refTOsurfTOtrace
rTtDOTrTsTt = DotProduct( refTOtrace, refTOsurfTOtrace );
@@ -1994,10 +1988,6 @@
//construct a point representing where the player is looking
VectorAdd( pm->ps->origin, lookdir, point );
- //check whether point is on one side of the plane, if so invert the correction angle
- if( ( abc[ 0 ] * point[ 0 ] + abc[ 1 ] * point[ 1 ] + abc[ 2 ] * point[ 2 ] - d ) > 0 )
- traceANGsurf = -traceANGsurf;
-
//find the . product of the lookdir and traceCROSSsurf
if( ( ldDOTtCs = DotProduct( lookdir, traceCROSSsurf ) ) < 0.0f )
{
@@ -2005,15 +1995,6 @@
ldDOTtCs = DotProduct( lookdir, traceCROSSsurf );
}
- //set the correction angle
- traceANGsurf *= 1.0f - ldDOTtCs;
-
- if( !( pm->ps->persistant[ PERS_STATE ] & PS_WALLCLIMBINGFOLLOW ) )
- {
- //correct the angle
- pm->ps->delta_angles[ PITCH ] -= ANGLE2SHORT( traceANGsurf );
- }
-
//transition from wall to ceiling
//normal for subsequent viewangle rotations
if( VectorCompare( trace.plane.normal, ceilingNormal ) )
More refined control and dealing with the gameplay consequences is left as an exercise for the reader. Note that if the entity you are wallwalking on moves, you are not carried with it.
Also, the patch is against MGDev SVN not Icculus but it should apply just fine. This is a client and server modification.