weapon_clipload = STAT(WEAPON_CLIPLOAD);
weapon_clipsize = STAT(WEAPON_CLIPSIZE);
- float ok_ammo_charge, ok_ammo_chargepool;
- ok_ammo_charge = STAT(OK_AMMO_CHARGE);
- ok_ammo_chargepool = STAT(OK_AMMO_CHARGEPOOL);
-
float vortex_charge, vortex_chargepool;
vortex_charge = STAT(VORTEX_CHARGE);
vortex_chargepool = STAT(VORTEX_CHARGEPOOL);
ring_rgb = wcross_color;
ring_image = "gfx/crosshair_ring.tga";
}
- else if (ok_ammo_charge)
- {
- ring_value = ok_ammo_chargepool;
- ring_alpha = autocvar_crosshair_ring_reload_alpha;
- ring_rgb = wcross_color;
- ring_image = "gfx/crosshair_ring.tga";
- }
else if(autocvar_crosshair_ring_reload && weapon_clipsize) // forces there to be only an ammo ring
{
ring_value = bound(0, weapon_clipload / weapon_clipsize, 1);
ColorTranslateMode = autocvar_cl_stripcolorcodes;
- entity wepent = viewmodels[0]; // TODO: unhardcode
-
- if(last_switchweapon != wepent.switchweapon)
+ for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
{
- weapontime = time;
- last_switchweapon = wepent.switchweapon;
- if(button_zoom && autocvar_cl_unpress_zoom_on_weapon_switch)
+ entity wepent = viewmodels[slot];
+
+ if(wepent.last_switchweapon != wepent.switchweapon)
{
- localcmd("-zoom\n");
- button_zoom = false;
+ weapontime = time;
+ wepent.last_switchweapon = wepent.switchweapon;
+ if(slot == 0 && button_zoom && autocvar_cl_unpress_zoom_on_weapon_switch)
+ {
+ localcmd("-zoom\n");
+ button_zoom = false;
+ }
+ if(slot == 0 && autocvar_cl_unpress_attack_on_weapon_switch)
+ {
+ localcmd("-fire\n");
+ localcmd("-fire2\n");
+ button_attack2 = false;
+ }
}
- if(autocvar_cl_unpress_attack_on_weapon_switch)
+ if(wepent.last_activeweapon != wepent.activeweapon)
{
- localcmd("-fire\n");
- localcmd("-fire2\n");
- button_attack2 = false;
- }
- }
- if(last_activeweapon != wepent.activeweapon)
- {
- last_activeweapon = wepent.activeweapon;
+ wepent.last_activeweapon = wepent.activeweapon;
- e = wepent.activeweapon;
- if(e.netname != "")
- localcmd(strcat("\ncl_hook_activeweapon ", e.netname), "\n");
- else
- localcmd("\ncl_hook_activeweapon none\n");
+ e = wepent.activeweapon;
+ if(e.netname != "")
+ localcmd(strcat("\ncl_hook_activeweapon ", e.netname), "\n");
+ else if(slot == 0)
+ localcmd("\ncl_hook_activeweapon none\n");
+ }
}
// ALWAYS Clear Current Scene First
if(autocvar_cl_reticle)
{
- string reticle_image = wepent.activeweapon.w_reticle;
+ string reticle_image = "";
bool wep_zoomed = false;
for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
{
if(wep != WEP_Null && wep.wr_zoom)
{
bool do_zoom = wep.wr_zoom(wep, NULL);
- reticle_image = wep.w_reticle;
+ if(wep.w_reticle && wep.w_reticle != "")
+ reticle_image = wep.w_reticle;
wep_zoomed += do_zoom;
}
}