diff --git a/main/source/mod/AvHEvents.cpp b/main/source/mod/AvHEvents.cpp index 4e62370c..32897790 100644 --- a/main/source/mod/AvHEvents.cpp +++ b/main/source/mod/AvHEvents.cpp @@ -117,6 +117,7 @@ #include "AvHClientVariables.h" #include "../util/MathUtil.h" #include "AvHHulls.h" +#include "AvHServerVariables.h" //extern AvHKnife gKnife; //extern AvHMachineGun gMachineGun; @@ -937,8 +938,10 @@ 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 oldpellets = (gHUD.GetServerVariableFloat(kvVersion) < 323.0f || gHUD.GetServerVariableFloat(kvNewsgspread) == 0.0f); - if ((CVAR_GET_FLOAT("sv_nsversion") < 323.0f) || (CVAR_GET_FLOAT("sv_newsgspread") == 0.0f)) + if (oldpellets) { 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/AvHSonicGun.cpp b/main/source/mod/AvHSonicGun.cpp index b8542c11..ab27ba19 100644 --- a/main/source/mod/AvHSonicGun.cpp +++ b/main/source/mod/AvHSonicGun.cpp @@ -214,9 +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); - bool oldshotty = (CVAR_GET_FLOAT("sv_nsversion") < 323.0f); + // 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); - if (oldshotty || (CVAR_GET_FLOAT("sv_newsgspread") == 0.0f)) + if (oldshotty) { this->m_pPlayer->FireBulletsPlayer(10, vecSrc, vecAiming, this->GetProjectileSpread(), this->mRange, BULLET_PLAYER_BUCKSHOT, 0, 17, 0, this->m_pPlayer->random_seed); }