]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Write a useful comment
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 30 Jan 2011 20:36:38 +0000 (22:36 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 30 Jan 2011 20:36:38 +0000 (22:36 +0200)
qcsrc/server/cl_client.qc
qcsrc/server/cl_weapons.qc

index cb1c18f926b6aa7a1bfafbde26614e4ab0fa079f..384d3b43dffe30b756d2e18f173aa814a17f56c4 100644 (file)
@@ -1056,7 +1056,7 @@ void PutClientInServer (void)
                        // all weapons must be fully loaded when we spawn
                        entity e;
                        e = get_weaponinfo(j);
-                       if(e.spawnflags & WEP_FLAG_RELOADABLE)
+                       if(e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
                                self.weapon_load[j] = cvar(strcat("g_balance_", e.netname, "_reload_ammo"));
                }
 
index d57883a292e372e916b7088b82818d7208bac3e1..9ccc48c9c9ff25a2eea1457b685d04c8a3083fc7 100644 (file)
@@ -344,7 +344,7 @@ void W_WeaponFrame()
                        // 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")))
+                       if(e.spawnflags & WEP_FLAG_RELOADABLE && cvar(strcat("g_balance_", e.netname, "_reload_ammo"))) // prevent accessing undefined cvars
                        {
                                self.clip_load = self.weapon_load[self.switchweapon];
                                self.clip_size = cvar(strcat("g_balance_", e.netname, "_reload_ammo"));