From 23740d81ebc9d90664c8851d5a91009402d0693f Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Tue, 20 Aug 2013 14:14:32 -0400 Subject: [PATCH] Start using new property system for reloading --- qcsrc/common/weapons/config.qc | 3 +-- qcsrc/common/weapons/w_blaster.qc | 1 - qcsrc/common/weapons/w_machinegun.qc | 3 ++- qcsrc/server/weapons/weaponsystem.qc | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/qcsrc/common/weapons/config.qc b/qcsrc/common/weapons/config.qc index 2f8bc06f7..5fec9caea 100644 --- a/qcsrc/common/weapons/config.qc +++ b/qcsrc/common/weapons/config.qc @@ -43,8 +43,7 @@ void Dump_Weapon_Settings(void) // step 4: write queue WEP_CONFIG_WRITETOFILE(sprintf("// {{{ #%d: %s\n", i, W_Name(i))) - for(x = 0; x <= WEP_CONFIG_COUNT; ++x) - { WEP_CONFIG_WRITETOFILE(wep_config_queue[x]) } + for(x = 0; x <= WEP_CONFIG_COUNT; ++x) { WEP_CONFIG_WRITETOFILE(wep_config_queue[x]) } WEP_CONFIG_WRITETOFILE("// }}}\n") // step 5: debug info diff --git a/qcsrc/common/weapons/w_blaster.qc b/qcsrc/common/weapons/w_blaster.qc index 7b5721018..5b7946ce5 100644 --- a/qcsrc/common/weapons/w_blaster.qc +++ b/qcsrc/common/weapons/w_blaster.qc @@ -173,7 +173,6 @@ void W_Laser_Shockwave() if(head.takedamage) { - // if it's a player, use the view origin as reference (stolen from RadiusDamage functions in g_damage.qc) center = PLAYER_CENTER(head); float distance_to_head = vlen(attack_hitpos - head.WarpZone_findradius_nearest); diff --git a/qcsrc/common/weapons/w_machinegun.qc b/qcsrc/common/weapons/w_machinegun.qc index 90939c583..a6f320a08 100644 --- a/qcsrc/common/weapons/w_machinegun.qc +++ b/qcsrc/common/weapons/w_machinegun.qc @@ -351,7 +351,8 @@ float w_uzi(float req) } case WR_RELOAD: { - W_Reload(min(max(WEP_CVAR(uzi, sustained_ammo), WEP_CVAR(uzi, first_ammo)), WEP_CVAR(uzi, burst_ammo)), autocvar_g_balance_uzi_reload_ammo, autocvar_g_balance_uzi_reload_time, "weapons/reload.wav"); + entity weapon = get_weaponinfo(WEP_UZI); + W_Reload(min(max(WEP_CVAR(uzi, sustained_ammo), WEP_CVAR(uzi, first_ammo)), WEP_CVAR(uzi, burst_ammo)), weapon.reloading_ammo, weapon.reloading_time, "weapons/reload.wav"); return TRUE; } case WR_SUICIDEMESSAGE: diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index 23441cbee..da7815fe7 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -690,10 +690,10 @@ void W_WeaponFrame() self.weaponentity.state = WS_RAISE; // set our clip load to the load of the weapon we switched to, if it's reloadable - if(newwep.spawnflags & WEP_FLAG_RELOADABLE && cvar(strcat("g_balance_", newwep.netname, "_reload_ammo"))) // prevent accessing undefined cvars + if(newwep.spawnflags & WEP_FLAG_RELOADABLE && newwep.reloading_ammo) // prevent accessing undefined cvars { self.clip_load = self.(weapon_load[self.switchweapon]); - self.clip_size = cvar(strcat("g_balance_", newwep.netname, "_reload_ammo")); + self.clip_size = newwep.reloading_ammo; } else self.clip_load = self.clip_size = 0; -- 2.39.2