summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/bg_misc.c8
-rw-r--r--src/game/bg_pmove.c34
2 files changed, 29 insertions, 13 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c
index 413ab89f..de83ee5f 100644
--- a/src/game/bg_misc.c
+++ b/src/game/bg_misc.c
@@ -4656,14 +4656,10 @@ qboolean BG_rotateAxis( vec3_t surfNormal, vec3_t inAxis[ 3 ],
VectorNormalize( xNormal );
}
- //if we're a wall climber.. and we're climbing rotate the axis
+ //can't rotate with no rotation vector
if( VectorLength( xNormal ) != 0.0f )
{
- //if the normal pointing straight down then the rotAngle will always be 180deg
- if( surfNormal[ 2 ] == -1.0f )
- rotAngle = 180.0f;
- else
- rotAngle = RAD2DEG( acos( DotProduct( localNormal, refNormal ) ) );
+ rotAngle = RAD2DEG( acos( DotProduct( localNormal, refNormal ) ) );
if( inverse )
rotAngle = -rotAngle;
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c
index 77692398..fdfc1074 100644
--- a/src/game/bg_pmove.c
+++ b/src/game/bg_pmove.c
@@ -1962,6 +1962,19 @@ static void PM_GroundClimbTrace( void )
pml.walking = qfalse;
pm->ps->eFlags &= ~EF_WALLCLIMB;
+ //just transided from ceiling to floor... apply delta correction
+ if( pm->ps->stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING )
+ {
+ vec3_t forward, rotated, angles;
+
+ AngleVectors( pm->ps->viewangles, forward, NULL, NULL );
+
+ RotatePointAroundVector( rotated, pm->ps->grapplePoint, forward, 180.0f );
+ vectoangles( rotated, angles );
+
+ pm->ps->delta_angles[ YAW ] -= ANGLE2SHORT( angles[ YAW ] - pm->ps->viewangles[ YAW ] );
+ }
+
pm->ps->stats[ STAT_STATE ] &= ~SS_WALLCLIMBINGCEILING;
//we get very bizarre effects if we don't do this :0
@@ -2024,8 +2037,21 @@ static void PM_GroundTrace( void )
PM_GroundClimbTrace( );
return;
}
- }
+ //just transided from ceiling to floor... apply delta correction
+ if( pm->ps->stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING )
+ {
+ vec3_t forward, rotated, angles;
+
+ AngleVectors( pm->ps->viewangles, forward, NULL, NULL );
+
+ RotatePointAroundVector( rotated, pm->ps->grapplePoint, forward, 180.0f );
+ vectoangles( rotated, angles );
+
+ pm->ps->delta_angles[ YAW ] -= ANGLE2SHORT( angles[ YAW ] - pm->ps->viewangles[ YAW ] );
+ }
+ }
+
pm->ps->stats[ STAT_STATE ] &= ~SS_WALLCLIMBING;
pm->ps->stats[ STAT_STATE ] &= ~SS_WALLCLIMBINGCEILING;
pm->ps->eFlags &= ~EF_WALLCLIMB;
@@ -2035,12 +2061,6 @@ static void PM_GroundTrace( void )
point[ 2 ] = pm->ps->origin[ 2 ] - 0.25f;
pm->trace( &trace, pm->ps->origin, pm->mins, pm->maxs, point, pm->ps->clientNum, pm->tracemask );
-/* if( trace.fraction < 1.0f && VectorCompare( trace.plane.normal, vec3_origin ) )
- {
- Com_Printf( "\n%v %d\n", trace.plane.normal, trace.entityNum );
- Com_Printf( "%v %v\n", pm->ps->origin, point );
- Com_Printf( "%d %d\n", trace.allsolid, trace.startsolid );
- }*/
pml.groundTrace = trace;