]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Loopify overkill
authorMario <mario@smbclan.net>
Thu, 24 Dec 2015 00:41:44 +0000 (10:41 +1000)
committerMario <mario@smbclan.net>
Thu, 24 Dec 2015 00:41:44 +0000 (10:41 +1000)
qcsrc/common/mutators/mutator/overkill/overkill.qc

index bd1a9efe308496c9a4cecb38b58d6c40b36514c7..d50c75bef97cf3dc921927ca4980aa2a6c4fbfe7 100644 (file)
@@ -244,8 +244,7 @@ MUTATOR_HOOKFUNCTION(ok, PlayerSpawn)
 {SELFPARAM();
        if(autocvar_g_overkill_ammo_charge)
        {
-               for(int i = WEP_FIRST; i <= WEP_LAST; ++i)
-                       self.ammo_charge[i] = autocvar_g_overkill_ammo_charge_limit;
+               FOREACH(Weapons, it != WEP_Null, LAMBDA(self.ammo_charge[it.m_id] = autocvar_g_overkill_ammo_charge_limit));
 
                self.ok_use_ammocharge = 1;
                self.ok_notice_time = time;