]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Loopify player death slots
authorMario <mario@smbclan.net>
Thu, 24 Dec 2015 00:05:00 +0000 (10:05 +1000)
committerMario <mario@smbclan.net>
Thu, 24 Dec 2015 00:05:18 +0000 (10:05 +1000)
qcsrc/server/cl_player.qc

index d205e65692fbdae38ed09d618d2e59f8e4265ac1..82fed046a0829f80a53ad1a515dbe1cedad75db8 100644 (file)
@@ -298,7 +298,6 @@ void calculate_player_respawn_time(entity this)
 void PlayerDamage (entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 {SELFPARAM();
        float take, save, dh, da;
-       int j;
        vector v;
        float valid_damage_for_weaponstats;
        float excess;
@@ -628,15 +627,13 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, int deathtyp
                }
 
                // reset fields the weapons may use just in case
-               for (j = WEP_FIRST; j <= WEP_LAST; ++j)
-               {
-                       Weapon w = Weapons_from(j);
-                       w.wr_resetplayer(w);
-                       for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+               FOREACH(Weapons, it != WEP_Null, LAMBDA(
+                       it.wr_resetplayer(it);
+                       for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
                        {
-                               ATTACK_FINISHED_FOR(self, j, slot) = 0;
+                               ATTACK_FINISHED_FOR(self, it.m_id, slot) = 0;
                        }
-               }
+               ));
        }
 }