fixed incorrect shotgun pellet visuals

This commit is contained in:
pierow 2021-02-08 05:46:11 -05:00
parent 4625887633
commit 7f44ef2c8b
2 changed files with 7 additions and 3 deletions

View file

@ -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);
}

View file

@ -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);
}