diff --git a/src/k_kart.c b/src/k_kart.c index 3d5b19adc..207581626 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -379,6 +379,8 @@ void K_RegisterKartStuff(void) CV_RegisterVar(&cv_test1); CV_RegisterVar(&cv_test2); CV_RegisterVar(&cv_test3); + + CV_RegisterVar(&cv_naturalcamera); } //} diff --git a/src/p_local.h b/src/p_local.h index 6a453b4bc..7b66b5366 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -28,6 +28,8 @@ extern "C" { #endif +extern consvar_t cv_naturalcamera; + #define FLOATSPEED (FRACUNIT*4) //#define VIEWHEIGHTS "41" diff --git a/src/p_user.c b/src/p_user.c index dc9219087..e637274c2 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -78,6 +78,9 @@ static void P_NukeAllPlayers(player_t *player); #endif +// Some people like the more limited camerea from V1 so why not. +consvar_t cv_naturalcamera = CVAR_INIT ("naturalcamera", "Off", CV_SAVE, CV_OnOff, NULL); + // // Jingle stuff. // @@ -3091,28 +3094,29 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall } // sets ideal cam pos + dist = camdist; + + if (player->loop.radius) + { + speed = player->speed; + } + else + { + speed = P_AproxDistance(P_AproxDistance(mo->momx, mo->momy), mo->momz / 16); + } + + if (cv_naturalcamera.value) { const fixed_t speedthreshold = 48*mapobjectscale; const fixed_t olddist = P_AproxDistance(mo->x - thiscam->x, mo->y - thiscam->y); fixed_t lag, distoffset; - dist = camdist; - if (player->karthud[khud_boostcam]) { dist -= FixedMul(11*dist/16, player->karthud[khud_boostcam]); } - if (player->loop.radius) - { - speed = player->speed; - } - else - { - speed = P_AproxDistance(P_AproxDistance(mo->momx, mo->momy), mo->momz / 16); - } - lag = FRACUNIT - ((FixedDiv(speed, speedthreshold) - FRACUNIT) * 2); if (lag > FRACUNIT) @@ -3133,6 +3137,17 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall dist = 0; } } + else + { + if (speed > K_GetKartSpeed(player, false, true)) + dist += 4*(speed - K_GetKartSpeed(player, false, true)); + dist += abs(thiscam->momz)/4; + + if (player->karthud[khud_boostcam]) + { + dist -= FixedMul(11*dist/16, player->karthud[khud_boostcam]); + } + } if (mo->standingslope) {