From c7acee5e87841fe2f20e6dde8168315574959e1a Mon Sep 17 00:00:00 2001 From: pierow Date: Tue, 8 Aug 2023 21:26:52 -0400 Subject: [PATCH] Removed v3.2 backwards compatability and some playtest cvars - Fork is now too different to maintain backwards compatability --- main/source/cl_dll/hl/hl_weapons.cpp | 2 +- main/source/dlls/game.cpp | 4 ---- main/source/dlls/player.cpp | 10 --------- main/source/dlls/weapons.cpp | 2 +- main/source/mod/AvHEvents.cpp | 14 ++++-------- main/source/mod/AvHGamerules.cpp | 2 -- main/source/mod/AvHMarineWeapon.cpp | 17 +++----------- main/source/mod/AvHPlayer.cpp | 2 +- main/source/mod/AvHServerVariables.h | 4 ---- main/source/mod/AvHSonicGun.cpp | 13 +++-------- main/source/pm_shared/pm_shared.cpp | 33 +++++++++------------------- 11 files changed, 23 insertions(+), 80 deletions(-) diff --git a/main/source/cl_dll/hl/hl_weapons.cpp b/main/source/cl_dll/hl/hl_weapons.cpp index f8de1e6e..e7aeee47 100644 --- a/main/source/cl_dll/hl/hl_weapons.cpp +++ b/main/source/cl_dll/hl/hl_weapons.cpp @@ -527,7 +527,7 @@ void CBasePlayerWeapon::ItemPostFrame( void ) if ( (m_pPlayer->pev->button & IN_ATTACK) && !(m_pPlayer->pev->button & IN_ATTACK2)) { - if ((m_fInSpecialReload == 1 || m_fInSpecialReload == 2) && m_iClip != 0 && (CVAR_GET_FLOAT("sv_nsversion") > 322.0f)) + if ((m_fInSpecialReload == 1 || m_fInSpecialReload == 2) && m_iClip != 0) { m_fInSpecialReload = 3; Reload(); diff --git a/main/source/dlls/game.cpp b/main/source/dlls/game.cpp index 0721461c..9e45fa25 100644 --- a/main/source/dlls/game.cpp +++ b/main/source/dlls/game.cpp @@ -124,9 +124,7 @@ cvar_t avh_blockscripts = {kvBlockScripts, "1", FCVAR_SERVER}; cvar_t avh_jumpmode = {kvJumpMode, "1", FCVAR_SERVER}; cvar_t avh_version = {kvVersion, "330", FCVAR_SERVER}; //playtest cvars -cvar_t avh_newsgspread = {kvNewsgspread, "1", FCVAR_SERVER}; cvar_t avh_fastjp = {kvfastjp, "0", FCVAR_SERVER}; -cvar_t avh_newlerk = {kvNewlerk, "1", FCVAR_SERVER}; #ifdef DEBUG cvar_t avh_testing = {kvTesting, "0", FCVAR_SERVER}; #endif @@ -239,9 +237,7 @@ void GameDLLInit( void ) CVAR_REGISTER (&avh_jumpmode); CVAR_REGISTER (&avh_version); //playtest cvars - CVAR_REGISTER (&avh_newsgspread); CVAR_REGISTER (&avh_fastjp); - CVAR_REGISTER (&avh_newlerk); // TODO: Remove CVAR_REGISTER (&avh_ironman); diff --git a/main/source/dlls/player.cpp b/main/source/dlls/player.cpp index 170e60fd..3435042d 100644 --- a/main/source/dlls/player.cpp +++ b/main/source/dlls/player.cpp @@ -3167,21 +3167,11 @@ void CBasePlayer::Spawn( void ) else g_engfuncs.pfnSetPhysicsKeyValue(edict(), "jm1", "0"); - if (avh_fastjp.value == 0 && avh_version.value > 321) - g_engfuncs.pfnSetPhysicsKeyValue(edict(), "jp", "1"); - else - g_engfuncs.pfnSetPhysicsKeyValue(edict(), "jp", "0"); - if (avh_fastjp.value == 1 && avh_version.value > 321) g_engfuncs.pfnSetPhysicsKeyValue(edict(), "jp2", "1"); else g_engfuncs.pfnSetPhysicsKeyValue(edict(), "jp2", "0"); - if (avh_newlerk.value == 1 && avh_version.value > 321) - g_engfuncs.pfnSetPhysicsKeyValue(edict(), "nl", "1"); - else - g_engfuncs.pfnSetPhysicsKeyValue(edict(), "nl", "0"); - pev->fov = m_iFOV = 0;// init field of view. m_iClientFOV = -1; // make sure fov reset is sent diff --git a/main/source/dlls/weapons.cpp b/main/source/dlls/weapons.cpp index de3e078b..3e9e151c 100644 --- a/main/source/dlls/weapons.cpp +++ b/main/source/dlls/weapons.cpp @@ -990,7 +990,7 @@ void CBasePlayerWeapon::ItemPostFrame( void ) if ( theAttackPressed && m_pPlayer->GetCanUseWeapon()) { - if ((m_fInSpecialReload == 1 || m_fInSpecialReload == 2) && m_iClip != 0 && (CVAR_GET_FLOAT("sv_nsversion") > 322.0f)) + if ((m_fInSpecialReload == 1 || m_fInSpecialReload == 2) && m_iClip != 0) { m_fInSpecialReload = 3; Reload(); diff --git a/main/source/mod/AvHEvents.cpp b/main/source/mod/AvHEvents.cpp index cff6d1e7..602358bc 100644 --- a/main/source/mod/AvHEvents.cpp +++ b/main/source/mod/AvHEvents.cpp @@ -938,17 +938,11 @@ void EV_SonicGun(struct event_args_s* args) // AvHParticleSystemManager::Instance()->CreateParticleSystem(kpsShotgun, theBarrelTip); // } //EV_HLDM_FireBullets( idx, forward, right, up, kSGBulletsPerShot, vecSrc, vecAiming, kSGRange, BULLET_PLAYER_BUCKSHOT, 0, &tracerCount[idx-1], VECTOR_CONE_20DEGREES.x, VECTOR_CONE_20DEGREES.y); - - bool newpellets = (gHUD.GetServerVariableFloat(kvVersion) > 322.0f || gHUD.GetServerVariableFloat(kvNewsgspread) != 0.0f); - if (!newpellets) - { - EV_HLDM_FireBulletsPlayer(idx, forward, right, up, 10, vecSrc, vecAiming, kSGRange, BULLET_PLAYER_BUCKSHOT, 0, &tracerCount[idx - 1], kSGSpread, args->iparam1); - } - else - { - EV_HLDM_FireBulletsPlayer(idx, forward, right, up, BALANCE_VAR(kSGBulletsPerShot), vecSrc, vecAiming, kSGRange, BULLET_PLAYER_BUCKSHOT, 0, &tracerCount[idx - 1], kSGSpread, args->iparam1); - } + ////Old 3.2 SG + //EV_HLDM_FireBulletsPlayer(idx, forward, right, up, 10, vecSrc, vecAiming, kSGRange, BULLET_PLAYER_BUCKSHOT, 0, &tracerCount[idx - 1], kSGSpread, args->iparam1); + + EV_HLDM_FireBulletsPlayer(idx, forward, right, up, BALANCE_VAR(kSGBulletsPerShot), vecSrc, vecAiming, kSGRange, BULLET_PLAYER_BUCKSHOT, 0, &tracerCount[idx - 1], kSGSpread, args->iparam1); //} // General x-punch axis diff --git a/main/source/mod/AvHGamerules.cpp b/main/source/mod/AvHGamerules.cpp index 523b14d2..7762d1dd 100644 --- a/main/source/mod/AvHGamerules.cpp +++ b/main/source/mod/AvHGamerules.cpp @@ -339,9 +339,7 @@ AvHGamerules::AvHGamerules() : mTeamA(TEAM_ONE), mTeamB(TEAM_TWO) RegisterServerVariable(&avh_structurelimit); RegisterServerVariable(&avh_version); //playtest cvars - RegisterServerVariable(&avh_newsgspread); RegisterServerVariable(&avh_fastjp); - RegisterServerVariable(&avh_newlerk); g_VoiceGameMgr.Init(&gVoiceHelper, gpGlobals->maxClients); diff --git a/main/source/mod/AvHMarineWeapon.cpp b/main/source/mod/AvHMarineWeapon.cpp index 1ff4174c..bc470b36 100644 --- a/main/source/mod/AvHMarineWeapon.cpp +++ b/main/source/mod/AvHMarineWeapon.cpp @@ -210,20 +210,9 @@ void AvHReloadableMarineWeapon::Reload(void) float theGotoReloadAnimationTime = this->GetGotoReloadAnimationTime(); - bool oldreload = (CVAR_GET_FLOAT("sv_nsversion") < 323.0f); - if (oldreload) - { - this->m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.1f; - this->m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.1f; - this->m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 1.1f; - this->m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.1f; - } - else - { - this->m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + theGotoReloadAnimationTime; - this->m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + theGotoReloadAnimationTime; - this->m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + theGotoReloadAnimationTime; - } + this->m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + theGotoReloadAnimationTime; + this->m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + theGotoReloadAnimationTime; + this->m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + theGotoReloadAnimationTime; this->m_pPlayer->SetAnimation(PLAYER_RELOAD_START); diff --git a/main/source/mod/AvHPlayer.cpp b/main/source/mod/AvHPlayer.cpp index 2cd4bfa4..23526462 100644 --- a/main/source/mod/AvHPlayer.cpp +++ b/main/source/mod/AvHPlayer.cpp @@ -1632,7 +1632,7 @@ void AvHPlayer::GetAnimationForActivity(int inActivity, char outAnimation[64], b break; case ACT_RUN: - if (theIsGlidingOnGround && CVAR_GET_FLOAT("sv_newlerk") != 0) + if (theIsGlidingOnGround) { strcat(outAnimation, "jump"); break; diff --git a/main/source/mod/AvHServerVariables.h b/main/source/mod/AvHServerVariables.h index 514d4c07..795d8980 100644 --- a/main/source/mod/AvHServerVariables.h +++ b/main/source/mod/AvHServerVariables.h @@ -97,9 +97,7 @@ extern cvar_t avh_killdelay; extern cvar_t *showtriggers; extern cvar_t avh_version; //playtest cvars -extern cvar_t avh_newsgspread; extern cvar_t avh_fastjp; -extern cvar_t avh_newlerk; char *ns_cvar_string(const cvar_t *cvar); int ns_cvar_int(const cvar_t *cvar); @@ -150,7 +148,5 @@ float ns_cvar_float(const cvar_t *cvar); #define kvJumpMode "sv_jumpmode" #define kvVersion "sv_nsversion" //playtest cvars -#define kvNewsgspread "sv_newsgspread" #define kvfastjp "sv_fastjp" -#define kvNewlerk "sv_newlerk" #endif diff --git a/main/source/mod/AvHSonicGun.cpp b/main/source/mod/AvHSonicGun.cpp index ab27ba19..261ac1d6 100644 --- a/main/source/mod/AvHSonicGun.cpp +++ b/main/source/mod/AvHSonicGun.cpp @@ -214,17 +214,10 @@ void AvHSonicGun::FireProjectiles(void) // Fire the bullets and apply damage //this->m_pPlayer->FireBullets(kSGBulletsPerShot, vecSrc, vecAiming, this->GetProjectileSpread(), this->mRange, 0, 0, theDamage); - // Client thinks these are 0 but this should run fine on the server. If client check is necessary, use gHUD.GetServerVariableFloat. - bool oldshotty = (CVAR_GET_FLOAT("sv_nsversion") < 323.0f || CVAR_GET_FLOAT("sv_newsgspread") == 0.0f); + ////Old v3.2 SG spread + //this->m_pPlayer->FireBulletsPlayer(10, vecSrc, vecAiming, this->GetProjectileSpread(), this->mRange, BULLET_PLAYER_BUCKSHOT, 0, 17, 0, this->m_pPlayer->random_seed); - if (oldshotty) - { - this->m_pPlayer->FireBulletsPlayer(10, vecSrc, vecAiming, this->GetProjectileSpread(), this->mRange, BULLET_PLAYER_BUCKSHOT, 0, 17, 0, this->m_pPlayer->random_seed); - } - else - { - this->m_pPlayer->FireBulletsPlayer(BALANCE_VAR(kSGBulletsPerShot), vecSrc, vecAiming, this->GetProjectileSpread(), this->mRange, BULLET_PLAYER_BUCKSHOT, 0, theDamage, 0, this->m_pPlayer->random_seed); - } + this->m_pPlayer->FireBulletsPlayer(BALANCE_VAR(kSGBulletsPerShot), vecSrc, vecAiming, this->GetProjectileSpread(), this->mRange, BULLET_PLAYER_BUCKSHOT, 0, theDamage, 0, this->m_pPlayer->random_seed); } bool AvHSonicGun::GetHasMuzzleFlash() const diff --git a/main/source/pm_shared/pm_shared.cpp b/main/source/pm_shared/pm_shared.cpp index 9d3d63f2..912697ff 100644 --- a/main/source/pm_shared/pm_shared.cpp +++ b/main/source/pm_shared/pm_shared.cpp @@ -2023,7 +2023,6 @@ void PM_PlayStepSound( int step, float fvol ) static int iSkipStep = 0; int irand; vec3_t hvel; - bool newlerk = atoi(pmove->PM_Info_ValueForKey(pmove->physinfo, "nl")); pmove->iStepLeft = !pmove->iStepLeft; @@ -2042,7 +2041,7 @@ void PM_PlayStepSound( int step, float fvol ) } // Don't play footsteps if gliding - if (pmove->iuser3 == AVH_USER3_ALIEN_PLAYER3 && pmove->cmd.buttons & IN_JUMP && pmove->oldbuttons & IN_JUMP && newlerk) + if (pmove->iuser3 == AVH_USER3_ALIEN_PLAYER3 && pmove->cmd.buttons & IN_JUMP && pmove->oldbuttons & IN_JUMP) { return; } @@ -3726,10 +3725,9 @@ void PM_CategorizePosition (void) pmove->onground = tr.ent; // Otherwise, point to index of ent under us. } - bool isglidinglerk = (pmove->iuser3 == AVH_USER3_ALIEN_PLAYER3 && pmove->cmd.buttons & IN_JUMP && pmove->oldbuttons & IN_JUMP); - bool newlerk = atoi(pmove->PM_Info_ValueForKey(pmove->physinfo, "nl")); + bool isGlidingLerk = (pmove->iuser3 == AVH_USER3_ALIEN_PLAYER3 && pmove->cmd.buttons & IN_JUMP && pmove->oldbuttons & IN_JUMP); - if ( gIsJetpacking[pmove->player_index] == 0 && (!isglidinglerk && newlerk)) { + if ( gIsJetpacking[pmove->player_index] == 0 && !isGlidingLerk) { // If we are on something... if (pmove->onground != -1) @@ -4611,12 +4609,9 @@ bool PM_FlapMove() } else { - bool newlerk = atoi(pmove->PM_Info_ValueForKey(pmove->physinfo, "nl")); - // Added by mmcguire. Lerk gliding. //if (pmove->iuser3 == AVH_USER3_ALIEN_PLAYER3 && pmove->onground == -1) - //if (pmove->iuser3 == AVH_USER3_ALIEN_PLAYER3/* && pmove->onground == -1*/) - if (pmove->iuser3 == AVH_USER3_ALIEN_PLAYER3 && (newlerk || pmove->onground == -1)) + if (pmove->iuser3 == AVH_USER3_ALIEN_PLAYER3) { // Compute the velocity not in the direction we're facing. float theGlideAmount = min(0.2f, PM_GetHorizontalSpeed() / 1000); @@ -6354,8 +6349,7 @@ void PM_Jetpack() // Turn off jetpack by default gIsJetpacking[pmove->player_index] = false; - bool newjp = atoi(pmove->PM_Info_ValueForKey(pmove->physinfo, "jp")); - bool fastjp = atoi(pmove->PM_Info_ValueForKey(pmove->physinfo, "jp2")); + bool fastJp = atoi(pmove->PM_Info_ValueForKey(pmove->physinfo, "jp2")); if(!pmove->dead && theHasJetpackUpgrade && !theIsDevoured) { @@ -6394,18 +6388,12 @@ void PM_Jetpack() //pmove->velocity[0] += (theWishVelocity[0]/pmove->clientmaxspeed)*kJetpackLateralScalar; //pmove->velocity[1] += (theWishVelocity[1]/pmove->clientmaxspeed)*kJetpackLateralScalar; - if (fastjp) + if (fastJp) { pmove->velocity[0] += ((theWishVelocity[0] / pmove->clientmaxspeed) * (theTimePassed * kJetpackForce) * 1.25f); pmove->velocity[1] += ((theWishVelocity[1] / pmove->clientmaxspeed) * (theTimePassed * kJetpackForce) * 1.25f); pmove->velocity[2] += theTimePassed * theWeightScalar*kJetpackForce; } - else if (!newjp) - { - pmove->velocity[0] += (theWishVelocity[0]/pmove->clientmaxspeed)*12.0f; - pmove->velocity[1] += (theWishVelocity[1]/pmove->clientmaxspeed)*12.0f; - pmove->velocity[2] += theTimePassed * theWeightScalar*kJetpackForce; - } else { pmove->velocity[0] += (theWishVelocity[0] / pmove->clientmaxspeed) * (theTimePassed * kJetpackForce); @@ -6736,12 +6724,11 @@ void PM_PlayerMove ( qboolean server ) pmove->flags &= ~FL_JUMPHELD; } - bool isglidinglerk = (pmove->iuser3 == AVH_USER3_ALIEN_PLAYER3 && pmove->cmd.buttons & IN_JUMP && pmove->oldbuttons & IN_JUMP); - bool newlerk = atoi(pmove->PM_Info_ValueForKey(pmove->physinfo, "nl")); + bool isGlidingLerk = (pmove->iuser3 == AVH_USER3_ALIEN_PLAYER3 && pmove->cmd.buttons & IN_JUMP && pmove->oldbuttons & IN_JUMP); // Fricion is handled before we add in any base velocity. That way, if we are on a conveyor, // we don't slow when standing still, relative to the conveyor. - if ((pmove->onground != -1 && gIsJetpacking[pmove->player_index] == 0 && (!isglidinglerk || !newlerk)) || GetHasUpgrade(pmove->iuser4, MASK_WALLSTICKING)) + if ((pmove->onground != -1 && gIsJetpacking[pmove->player_index] == 0 && !isGlidingLerk) || GetHasUpgrade(pmove->iuser4, MASK_WALLSTICKING)) { if(!GetHasUpgrade(pmove->iuser4, MASK_WALLSTICKING)) pmove->velocity[2] = 0.0; @@ -6752,7 +6739,7 @@ void PM_PlayerMove ( qboolean server ) PM_CheckVelocity(); // Are we on ground now - if ( (pmove->onground != -1 && gIsJetpacking[pmove->player_index] == 0 && (!isglidinglerk || !newlerk)) || GetHasUpgrade(pmove->iuser4, MASK_WALLSTICKING) ) + if ( (pmove->onground != -1 && gIsJetpacking[pmove->player_index] == 0 && !isGlidingLerk) || GetHasUpgrade(pmove->iuser4, MASK_WALLSTICKING) ) { PM_WalkMove(); } @@ -6782,7 +6769,7 @@ void PM_PlayerMove ( qboolean server ) } // If we are on ground, no downward velocity. - if ((pmove->onground != -1 && gIsJetpacking[pmove->player_index] == 0 && (!isglidinglerk || !newlerk)) && !GetHasUpgrade(pmove->iuser4, MASK_WALLSTICKING)) + if ((pmove->onground != -1 && gIsJetpacking[pmove->player_index] == 0 && !isGlidingLerk) && !GetHasUpgrade(pmove->iuser4, MASK_WALLSTICKING)) { pmove->velocity[2] = 0; }