From a1f5c3ed0df63ca5f6bd2744381e7ebae26f4c96 Mon Sep 17 00:00:00 2001 From: pierow Date: Sat, 23 Jan 2021 18:51:30 -0500 Subject: [PATCH] playtest cvar additions --- main/source/dlls/client.cpp | 4 ++-- main/source/dlls/game.cpp | 6 ++++++ main/source/dlls/player.cpp | 7 ++++++- main/source/mod/AvHEvents.cpp | 2 +- main/source/mod/AvHGamerules.cpp | 3 +++ main/source/mod/AvHServerVariables.h | 7 ++++++- main/source/mod/AvHSonicGun.cpp | 3 ++- main/source/pm_shared/pm_shared.cpp | 10 +++++++++- 8 files changed, 35 insertions(+), 7 deletions(-) diff --git a/main/source/dlls/client.cpp b/main/source/dlls/client.cpp index ead19325..fb5d8469 100644 --- a/main/source/dlls/client.cpp +++ b/main/source/dlls/client.cpp @@ -2393,8 +2393,8 @@ int InconsistentFile( const edict_t *player, const char *filename, char *disconn }*/ if (strstr(filename, "dlls/") != NULL) { - sprintf(disconnect_message, "(%s) Your NS version differs from the server's. Go to github.com/ENSL/NS#downloads or run Natural Launcher for the latest version.\n", filename); - //sprintf(disconnect_message, "(%s) This server is running an experimental NS build. Enable experimental build in Natural Launcher settings. github.com/ENSL/NS#downloads\n", filename); + //sprintf(disconnect_message, "(%s) Your NS version differs from the server's. Go to github.com/ENSL/NS#downloads or run Natural Launcher for the latest version.\n", filename); + sprintf(disconnect_message, "(%s) This server is running an experimental NS build. Enable experimental build in Natural Launcher settings. github.com/ENSL/NS#downloads\n", filename); return 1; } diff --git a/main/source/dlls/game.cpp b/main/source/dlls/game.cpp index 3cb35cc5..c3662b40 100644 --- a/main/source/dlls/game.cpp +++ b/main/source/dlls/game.cpp @@ -123,6 +123,9 @@ cvar_t avh_mapvoteratio = {kvMapVoteRatio, ".6", FCVAR_SERVER}; cvar_t avh_blockscripts = {kvBlockScripts, "1", FCVAR_SERVER}; cvar_t avh_jumpmode = {kvJumpMode, "1", FCVAR_SERVER}; cvar_t avh_version = {kvVersion, "323", FCVAR_SERVER }; +//playtest cvars +cvar_t avh_newsgspread = {kvNewsgspread, "1", FCVAR_SERVER }; +cvar_t avh_fastjp = {kvfastjp, "0", FCVAR_SERVER }; #ifdef DEBUG cvar_t avh_testing = {kvTesting, "0", FCVAR_SERVER}; #endif @@ -234,6 +237,9 @@ void GameDLLInit( void ) CVAR_REGISTER (&avh_blockscripts); CVAR_REGISTER (&avh_jumpmode); CVAR_REGISTER (&avh_version); + //playtest cvars + CVAR_REGISTER (&avh_newsgspread); + CVAR_REGISTER (&avh_fastjp); // TODO: Remove CVAR_REGISTER (&avh_ironman); diff --git a/main/source/dlls/player.cpp b/main/source/dlls/player.cpp index 92346608..0d995059 100644 --- a/main/source/dlls/player.cpp +++ b/main/source/dlls/player.cpp @@ -3166,11 +3166,16 @@ void CBasePlayer::Spawn( void ) else g_engfuncs.pfnSetPhysicsKeyValue(edict(), "jm1", "0"); - if (avh_version.value > 321) + 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"); + pev->fov = m_iFOV = 0;// init field of view. m_iClientFOV = -1; // make sure fov reset is sent diff --git a/main/source/mod/AvHEvents.cpp b/main/source/mod/AvHEvents.cpp index ed5a3b35..4e62370c 100644 --- a/main/source/mod/AvHEvents.cpp +++ b/main/source/mod/AvHEvents.cpp @@ -938,7 +938,7 @@ void EV_SonicGun(struct event_args_s* args) // } //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); - if (CVAR_GET_FLOAT("sv_nsversion") < 323.0f) + if ((CVAR_GET_FLOAT("sv_nsversion") < 323.0f) || (CVAR_GET_FLOAT("sv_newsgspread") == 0.0f)) { EV_HLDM_FireBulletsPlayer(idx, forward, right, up, 10, vecSrc, vecAiming, kSGRange, BULLET_PLAYER_BUCKSHOT, 0, &tracerCount[idx - 1], kSGSpread, args->iparam1); } diff --git a/main/source/mod/AvHGamerules.cpp b/main/source/mod/AvHGamerules.cpp index 3927ef62..6604e6cc 100644 --- a/main/source/mod/AvHGamerules.cpp +++ b/main/source/mod/AvHGamerules.cpp @@ -338,6 +338,9 @@ AvHGamerules::AvHGamerules() : mTeamA(TEAM_ONE), mTeamB(TEAM_TWO) RegisterServerVariable(avh_cheats); RegisterServerVariable(&avh_structurelimit); RegisterServerVariable(&avh_version); + //playtest cvars + RegisterServerVariable(&avh_newsgspread); + RegisterServerVariable(&avh_fastjp); g_VoiceGameMgr.Init(&gVoiceHelper, gpGlobals->maxClients); diff --git a/main/source/mod/AvHServerVariables.h b/main/source/mod/AvHServerVariables.h index f518b87c..324c61dc 100644 --- a/main/source/mod/AvHServerVariables.h +++ b/main/source/mod/AvHServerVariables.h @@ -96,6 +96,9 @@ extern cvar_t *violence_agibs; 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; char *ns_cvar_string(const cvar_t *cvar); int ns_cvar_int(const cvar_t *cvar); @@ -145,5 +148,7 @@ float ns_cvar_float(const cvar_t *cvar); #define kvBlockScripts "mp_blockscripts" #define kvJumpMode "sv_jumpmode" #define kvVersion "sv_nsversion" - +//playtest cvars +#define kvNewsgspread "sv_newsgspread" +#define kvfastjp "sv_fastjp" #endif diff --git a/main/source/mod/AvHSonicGun.cpp b/main/source/mod/AvHSonicGun.cpp index e1350202..b8542c11 100644 --- a/main/source/mod/AvHSonicGun.cpp +++ b/main/source/mod/AvHSonicGun.cpp @@ -215,7 +215,8 @@ void AvHSonicGun::FireProjectiles(void) //this->m_pPlayer->FireBullets(kSGBulletsPerShot, vecSrc, vecAiming, this->GetProjectileSpread(), this->mRange, 0, 0, theDamage); bool oldshotty = (CVAR_GET_FLOAT("sv_nsversion") < 323.0f); - if (oldshotty) + + if (oldshotty || (CVAR_GET_FLOAT("sv_newsgspread") == 0.0f)) { this->m_pPlayer->FireBulletsPlayer(10, vecSrc, vecAiming, this->GetProjectileSpread(), this->mRange, BULLET_PLAYER_BUCKSHOT, 0, 17, 0, this->m_pPlayer->random_seed); } diff --git a/main/source/pm_shared/pm_shared.cpp b/main/source/pm_shared/pm_shared.cpp index 0e827e34..a2033740 100644 --- a/main/source/pm_shared/pm_shared.cpp +++ b/main/source/pm_shared/pm_shared.cpp @@ -6341,6 +6341,7 @@ void PM_Jetpack() 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")); if(!pmove->dead && theHasJetpackUpgrade && !theIsDevoured) { @@ -6378,7 +6379,14 @@ void PM_Jetpack() // Old lateral jetpack code - acceleration scales with framerate //pmove->velocity[0] += (theWishVelocity[0]/pmove->clientmaxspeed)*kJetpackLateralScalar; //pmove->velocity[1] += (theWishVelocity[1]/pmove->clientmaxspeed)*kJetpackLateralScalar; - if (!newjp) + + if (fastjp) + { + pmove->velocity[0] += (theWishVelocity[0] / pmove->clientmaxspeed) * (theTimePassed * theWeightScalar * 1562.5f); + pmove->velocity[1] += (theWishVelocity[1] / pmove->clientmaxspeed) * (theTimePassed * theWeightScalar * 1562.5f); + 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;