]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Start using new property system for reloading
authorSamual Lenks <samual@xonotic.org>
Tue, 20 Aug 2013 18:14:32 +0000 (14:14 -0400)
committerSamual Lenks <samual@xonotic.org>
Tue, 20 Aug 2013 18:14:32 +0000 (14:14 -0400)
qcsrc/common/weapons/config.qc
qcsrc/common/weapons/w_blaster.qc
qcsrc/common/weapons/w_machinegun.qc
qcsrc/server/weapons/weaponsystem.qc

index 2f8bc06f7caeedf6b52a1b08f5f0049afc46c0e6..5fec9caeace0bd53bf25b0614f4e7299ea72ee46 100644 (file)
@@ -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
index 7b572101853956dd733b11d6ef7a264e32a2595d..5b7946ce545941cc1bcabb5a008df0a0dc93b456 100644 (file)
@@ -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);
index 90939c5839885ec6735e3aefc19c00885f742c0f..a6f320a08ff4bfa6f4bdef96ce13f3dbba8fae0b 100644 (file)
@@ -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:
index 23441cbee787ce5e8e017c976632435e9fe2d858..da7815fe701c1aaa5a8a05fa1bb121220520b187 100644 (file)
@@ -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;