setanim(self, self.anim_draw, FALSE, TRUE, TRUE);
self.weaponentity.state = WS_RAISE;
weapon_action(self.switchweapon, WR_SETUP);
+
+ // set our clip load to the load of the weapon we switched to, if it's reloadable
+ entity e;
+ e = get_weaponinfo(self.switchweapon);
+ if(e.spawnflags & WEP_FLAG_RELOADABLE && cvar(strcat("g_balance_", e.netname, "_reload_ammo")))
+ {
+ self.clip_load = self.weapon_load[self.switchweapon];
+ self.clip_size = cvar(strcat("g_balance_", e.netname, "_reload_ammo"));
+ }
+ else
+ self.clip_load = self.clip_size = 0;
+
// VorteX: add player model weapon select frame here
// setcustomframe(PlayerWeaponRaise);
weapon_thinkf(WFRAME_IDLE, autocvar_g_balance_weaponswitchdelay, w_ready);
.entity queuenext;
.entity queueprev;
-void W_Crylink_SetAmmoCounter()
-{
- // set clip_load to the weapon we have switched to, if the gun uses reloading
- if(!autocvar_g_balance_crylink_reload_ammo)
- self.clip_load = 0; // also keeps crosshair ammo from displaying
- else
- {
- self.clip_load = self.weapon_load[WEP_CRYLINK];
- self.clip_size = autocvar_g_balance_crylink_reload_ammo; // for the crosshair ammo display
- }
-}
-
void W_Crylink_Reload()
{
self.reload_ammo_player = ammo_cells;
else if (req == WR_SETUP)
{
weapon_setup(WEP_CRYLINK);
- W_Crylink_SetAmmoCounter();
}
else if (req == WR_CHECKAMMO1)
{
.float electro_count;
.float electro_secondarytime;
-void W_Electro_SetAmmoCounter()
-{
- // set clip_load to the weapon we have switched to, if the gun uses reloading
- if(!autocvar_g_balance_electro_reload_ammo)
- self.clip_load = 0; // also keeps crosshair ammo from displaying
- else
- {
- self.clip_load = self.weapon_load[WEP_ELECTRO];
- self.clip_size = autocvar_g_balance_electro_reload_ammo; // for the crosshair ammo display
- }
-}
-
void W_Electro_Reload()
{
self.reload_ammo_player = ammo_cells;
else if (req == WR_SETUP)
{
weapon_setup(WEP_ELECTRO);
- W_Electro_SetAmmoCounter();
}
else if (req == WR_CHECKAMMO1)
{
.vector fireball_impactvec;
.float fireball_primarytime;
-void W_Fireball_SetAmmoCounter()
-{
- // set clip_load to the weapon we have switched to, if the gun uses reloading
- if(!autocvar_g_balance_fireball_reload_ammo)
- self.clip_load = 0; // also keeps crosshair ammo from displaying
- else
- {
- self.clip_load = self.weapon_load[WEP_FIREBALL];
- self.clip_size = autocvar_g_balance_fireball_reload_ammo; // for the crosshair ammo display
- }
-}
-
void W_Fireball_Reload()
{
// fuel can be a non-whole number, which brakes stuff here when between 0 and 1
else if (req == WR_SETUP)
{
weapon_setup(WEP_FIREBALL);
- W_Fireball_SetAmmoCounter();
}
else if (req == WR_CHECKAMMO1)
{
.float gl_detonate_later;
.float gl_bouncecnt;
-void W_GrenadeLauncher_SetAmmoCounter()
-{
- // set clip_load to the weapon we have switched to, if the gun uses reloading
- if(!autocvar_g_balance_grenadelauncher_reload_ammo)
- self.clip_load = 0; // also keeps crosshair ammo from displaying
- else
- {
- self.clip_load = self.weapon_load[WEP_GRENADE_LAUNCHER];
- self.clip_size = autocvar_g_balance_grenadelauncher_reload_ammo; // for the crosshair ammo display
- }
-}
-
void W_GrenadeLauncher_Reload()
{
self.reload_ammo_player = ammo_rockets;
else if (req == WR_SETUP)
{
weapon_setup(WEP_GRENADE_LAUNCHER);
- W_GrenadeLauncher_SetAmmoCounter();
}
else if (req == WR_CHECKAMMO1)
{
#ifdef SVQC
// NO bounce protection, as bounces are limited!
-void W_Hagar_SetAmmoCounter()
-{
- // set clip_load to the weapon we have switched to, if the gun uses reloading
- if(!autocvar_g_balance_hagar_reload_ammo)
- self.clip_load = 0; // also keeps crosshair ammo from displaying
- else
- {
- self.clip_load = self.weapon_load[WEP_HAGAR];
- self.clip_size = autocvar_g_balance_hagar_reload_ammo; // for the crosshair ammo display
- }
-}
-
void W_Hagar_Reload()
{
self.reload_ammo_player = ammo_rockets;
else if (req == WR_SETUP)
{
weapon_setup(WEP_HAGAR);
- W_Hagar_SetAmmoCounter();
}
else if (req == WR_CHECKAMMO1)
{
#else
#ifdef SVQC
-void W_HLAC_SetAmmoCounter()
-{
- // set clip_load to the weapon we have switched to, if the gun uses reloading
- if(!autocvar_g_balance_hlac_reload_ammo)
- self.clip_load = 0; // also keeps crosshair ammo from displaying
- else
- {
- self.clip_load = self.weapon_load[WEP_HLAC];
- self.clip_size = autocvar_g_balance_hlac_reload_ammo; // for the crosshair ammo display
- }
-}
-
void W_HLAC_Reload()
{
self.reload_ammo_player = ammo_cells;
else if (req == WR_SETUP)
{
weapon_setup(WEP_HLAC);
- W_HLAC_SetAmmoCounter();
}
else if (req == WR_CHECKAMMO1)
{
#ifdef SVQC
void(float imp) W_SwitchWeapon;
-void W_Laser_SetAmmoCounter()
-{
- // set clip_load to the weapon we have switched to, if the gun uses reloading
- if(!autocvar_g_balance_laser_reload_ammo)
- self.clip_load = 0; // also keeps crosshair ammo from displaying
- else
- {
- self.clip_load = self.weapon_load[WEP_LASER];
- self.clip_size = autocvar_g_balance_laser_reload_ammo; // for the crosshair ammo display
- }
-}
-
void W_Laser_Reload()
{
self.(self.reload_ammo_player) = 1;
else if (req == WR_SETUP)
{
weapon_setup(WEP_LASER);
- W_Laser_SetAmmoCounter();
}
else if (req == WR_CHECKAMMO1)
{
.float minelayer_detonate, minelayer_mines;
.float mine_time;
-void W_MineLayer_SetAmmoCounter()
-{
- // set clip_load to the weapon we have switched to, if the gun uses reloading
- if(!autocvar_g_balance_minelayer_reload_ammo)
- self.clip_load = 0; // also keeps crosshair ammo from displaying
- else
- {
- self.clip_load = self.weapon_load[WEP_MINE_LAYER];
- self.clip_size = autocvar_g_balance_minelayer_reload_ammo; // for the crosshair ammo display
- }
-}
-
void W_MineLayer_Reload()
{
self.reload_ammo_player = ammo_rockets;
else if (req == WR_SETUP)
{
weapon_setup(WEP_MINE_LAYER);
- W_MineLayer_SetAmmoCounter();
}
else if (req == WR_CHECKAMMO1)
{
#ifdef SVQC
.float minstanex_lasthit;
-void W_Minstanex_SetAmmoCounter()
-{
- // set clip_load to the weapon we have switched to, if the gun uses reloading
- if(!autocvar_g_balance_minstanex_reload_ammo)
- self.clip_load = 0; // also keeps crosshair ammo from displaying
- else
- {
- self.clip_load = self.weapon_load[WEP_MINSTANEX];
- self.clip_size = autocvar_g_balance_minstanex_reload_ammo; // for the crosshair ammo display
- }
-}
-
void W_Minstanex_Reload()
{
self.reload_ammo_player = ammo_cells;
else if (req == WR_SETUP)
{
weapon_setup(WEP_MINSTANEX);
- W_Minstanex_SetAmmoCounter();
self.minstanex_lasthit = 0;
}
else if (req == WR_CHECKAMMO1)
#else
#ifdef SVQC
-void W_Nex_SetAmmoCounter()
-{
- // set clip_load to the weapon we have switched to, if the gun uses reloading
- if(!autocvar_g_balance_nex_reload_ammo)
- self.clip_load = 0; // also keeps crosshair ammo from displaying
- else
- {
- self.clip_load = self.weapon_load[WEP_NEX];
- self.clip_size = autocvar_g_balance_nex_reload_ammo; // for the crosshair ammo display
- }
-}
-
void W_Nex_Reload()
{
self.reload_ammo_player = ammo_cells;
else if (req == WR_SETUP)
{
weapon_setup(WEP_NEX);
- W_Nex_SetAmmoCounter();
}
else if (req == WR_CHECKAMMO1)
{
.float rl_release;
.float rl_detonate_later;
-void W_RocketLauncher_SetAmmoCounter()
-{
- // set clip_load to the weapon we have switched to, if the gun uses reloading
- if(!autocvar_g_balance_rocketlauncher_reload_ammo)
- self.clip_load = 0; // also keeps crosshair ammo from displaying
- else
- {
- self.clip_load = self.weapon_load[WEP_ROCKET_LAUNCHER];
- self.clip_size = autocvar_g_balance_rocketlauncher_reload_ammo; // for the crosshair ammo display
- }
-}
-
void W_RocketLauncher_Reload()
{
self.reload_ammo_player = ammo_rockets;
else if (req == WR_SETUP)
{
weapon_setup(WEP_ROCKET_LAUNCHER);
- W_RocketLauncher_SetAmmoCounter();
self.rl_release = 1;
}
else if (req == WR_CHECKAMMO1)
//.float proxytime; = autoswitch
//.float tl; = wait
-void W_Seeker_SetAmmoCounter()
-{
- // set clip_load to the weapon we have switched to, if the gun uses reloading
- if(!autocvar_g_balance_seeker_reload_ammo)
- self.clip_load = 0; // also keeps crosshair ammo from displaying
- else
- {
- self.clip_load = self.weapon_load[WEP_SEEKER];
- self.clip_size = autocvar_g_balance_seeker_reload_ammo; // for the crosshair ammo display
- }
-}
-
void W_Seeker_Reload()
{
self.reload_ammo_player = ammo_rockets;
else if (req == WR_SETUP)
{
weapon_setup(WEP_SEEKER);
- W_Seeker_SetAmmoCounter();
}
else if (req == WR_CHECKAMMO1)
{
#else
#ifdef SVQC
-void W_Shotgun_SetAmmoCounter()
-{
- // set clip_load to the weapon we have switched to, if the gun uses reloading
- if(!autocvar_g_balance_shotgun_reload_ammo)
- self.clip_load = 0; // also keeps crosshair ammo from displaying
- else
- {
- self.clip_load = self.weapon_load[WEP_SHOTGUN];
- self.clip_size = autocvar_g_balance_shotgun_reload_ammo; // for the crosshair ammo display
- }
-}
-
void W_Shotgun_Reload()
{
self.reload_ammo_player = ammo_shells;
else if (req == WR_SETUP)
{
weapon_setup(WEP_SHOTGUN);
- W_Shotgun_SetAmmoCounter();
}
else if (req == WR_CHECKAMMO1)
{
.float sniperrifle_accumulator;
-void W_SniperRifle_SetAmmoCounter()
-{
- // set clip_load to the weapon we have switched to, if the gun uses reloading
- if(!autocvar_g_balance_sniperrifle_reload_ammo)
- self.clip_load = 0; // also keeps crosshair ammo from displaying
- else
- {
- self.clip_load = self.weapon_load[WEP_SNIPERRIFLE];
- self.clip_size = autocvar_g_balance_sniperrifle_reload_ammo; // for the crosshair ammo display
- }
-}
-
void W_SniperRifle_Reload()
{
self.reload_ammo_player = ammo_nails;
else if (req == WR_SETUP)
{
weapon_setup(WEP_SNIPERRIFLE);
- W_SniperRifle_SetAmmoCounter();
}
else if (req == WR_CHECKAMMO1)
{
#else
#ifdef SVQC
-void W_UZI_SetAmmoCounter()
-{
- // set clip_load to the weapon we have switched to, if the gun uses reloading
- if(!autocvar_g_balance_uzi_reload_ammo)
- self.clip_load = 0; // also keeps crosshair ammo from displaying
- else
- {
- self.clip_load = self.weapon_load[WEP_UZI];
- self.clip_size = autocvar_g_balance_uzi_reload_ammo; // for the crosshair ammo display
- }
-}
-
void W_UZI_Reload()
{
self.reload_ammo_player = ammo_nails;
else if (req == WR_SETUP)
{
weapon_setup(WEP_UZI);
- W_UZI_SetAmmoCounter();
}
else if (req == WR_CHECKAMMO1)
{