cl_weaponcfgs and onos charge stick update

This commit is contained in:
pierow 2021-10-29 12:18:58 -04:00
parent 30c66a434b
commit 22a171f4b5
3 changed files with 27 additions and 11 deletions

View file

@ -694,16 +694,30 @@ void CHudAmmo::Think(void)
}
if (gHUD.GetCurrentWeaponID() != gWR.LastWeaponId)
if (gHUD.GetCurrentWeaponID() != gWR.lastWeaponId)
{
gWR.LastWeaponId = gHUD.GetCurrentWeaponID();
gWR.lastWeaponId = gHUD.GetCurrentWeaponID();
ClientCmd("exec weaponcfgs/default.cfg");
float wCfgCvar = CVAR_GET_FLOAT("cl_weaponcfgs");
WEAPON* currentWeapon = gWR.GetWeapon(gHUD.GetCurrentWeaponID());
char weapcfg[128];
sprintf(weapcfg, "exec weaponcfgs/%s.cfg", currentWeapon->szName);
ClientCmd(weapcfg);
if (wCfgCvar == 1)
{
ClientCmd("exec weaponcfgs/default.cfg");
WEAPON* currentWeapon = gWR.GetWeapon(gHUD.GetCurrentWeaponID());
char weapcfg[128];
sprintf(weapcfg, "exec weaponcfgs/%s.cfg", currentWeapon->szName);
ClientCmd(weapcfg);
}
//else if (wCfgCvar == 2.0f)
//{
// ClientCmd("exec weaponcfgs/nsdefaults/default.cfg");
// WEAPON* currentWeapon = gWR.GetWeapon(gHUD.GetCurrentWeaponID());
// char weapcfg[128];
// sprintf(weapcfg, "exec weaponcfgs/nsdefaults/%s.cfg", currentWeapon->szName);
// ClientCmd(weapcfg);
//}
}
if(gHUD.GetIsAlien()) //check for hive death causing loss of current weapon

View file

@ -76,7 +76,7 @@ private:
int riAmmo[MAX_AMMO_TYPES]; // current ammo counts
int iOldWeaponBits;
int LastWeaponId;
int lastWeaponId;
};
extern WeaponsResource gWR;

View file

@ -144,6 +144,7 @@ cvar_t *senslock;
cvar_t *hud_style;
cvar_t *cl_chatbeep;
cvar_t *cl_mutemenu;
cvar_t *cl_weaponcfgs;
/*
===============================================================================
@ -805,11 +806,11 @@ void IN_AttackUp(void)
{
KeyUp( &in_attack );
in_cancel = 0;
// Attack2up only for onos so it can end +attack onos charges. Attack2up for all causes blink and leap to cancel if you release attack while blinking or leaping.
if (gViewPort)
if (g_iUser3 == AVH_USER3_ALIEN_PLAYER5)
{
if (gHUD.GetHUDUser3() == AVH_USER3_ALIEN_PLAYER5)
IN_Attack2Up();
IN_Attack2Up();
}
}
@ -1621,6 +1622,7 @@ void InitInput (void)
hud_style = gEngfuncs.pfnRegisterVariable ("hud_style", "1", FCVAR_ARCHIVE);
cl_chatbeep = gEngfuncs.pfnRegisterVariable ("cl_chatbeep", "1", FCVAR_ARCHIVE);
cl_mutemenu = gEngfuncs.pfnRegisterVariable ("cl_mutemenu", "3", FCVAR_ARCHIVE);
cl_weaponcfgs = gEngfuncs.pfnRegisterVariable ("cl_weaponcfgs", "1", FCVAR_ARCHIVE);
// Initialize third person camera controls.
CAM_Init();