There is an unexpected problem when it is tied to a cvar.
It looks like it is not taking the current origin of the player and setting it to 0 when turned back on. It is using the z origin from the camera spawned.
If you start a level, and then go to an area where the player must go up or down, like an elevator shaft, turn off the cvar, and then head upwards. Once in the new higher or lower area, if the cvar is turned back on, it puts the camera back to its original z level. Its not setting it to 0 based upon the current position when triggered.
This is how the code was set up:
Quote:
idVec3 idPlayer::GetEyePosition( void ) const {
idVec3 org;
// use the smoothed origin if spectating another player in multiplayer
if ( gameLocal.isClient && entityNumber != gameLocal.localClientNum ) {
org = smoothedOrigin;
}
////START 6TH VENOM/REVILITY STOP THE CAMERA FROM MOVING VERTICALLY
//else {
//org = GetPhysics()->GetOrigin();
//}
if ( !pm_thirdPersonUp.GetBool() ) {
org = GetPhysics()->GetOrigin();
org.z = 0.0f; // force the Z position to zero
}
else {
org = GetPhysics()->GetOrigin();
}
////END 6TH VENOM/REVILITY STOP THE CAMERA FROM MOVING VERTICALLY
return org + ( GetPhysics()->GetGravityNormal() * -eyeOffset.z );
}