]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
More loops
authorMario <mario@smbclan.net>
Thu, 24 Dec 2015 02:37:57 +0000 (12:37 +1000)
committerMario <mario@smbclan.net>
Thu, 24 Dec 2015 02:37:57 +0000 (12:37 +1000)
qcsrc/common/mutators/mutator/touchexplode/touchexplode.qc

index ec439489d0de383c50681330fc4225a56c62c600..2b9ca637d1bd81a5f90f903804478214314c61bf 100644 (file)
@@ -29,19 +29,18 @@ MUTATOR_HOOKFUNCTION(touchexplode, PlayerPreThink)
        if(!self.frozen)
        if(IS_PLAYER(self))
        if(self.deadflag == DEAD_NO)
-       if (!IS_INDEPENDENT_PLAYER(self))
-       FOR_EACH_PLAYER(other) if(self != other)
-       {
-               if(time > other.touchexplode_time)
-               if(!other.frozen)
-               if(other.deadflag == DEAD_NO)
-               if (!IS_INDEPENDENT_PLAYER(other))
-               if(boxesoverlap(self.absmin, self.absmax, other.absmin, other.absmax))
-               {
-                       PlayerTouchExplode(self, other);
-                       self.touchexplode_time = other.touchexplode_time = time + 0.2;
-               }
-       }
+       if(!IS_INDEPENDENT_PLAYER(self))
+               FOREACH_CLIENT(IS_PLAYER(it) && it != self, LAMBDA(
+                       if(time > it.touchexplode_time)
+                       if(!it.frozen)
+                       if(it.deadflag == DEAD_NO)
+                       if (!IS_INDEPENDENT_PLAYER(it))
+                       if(boxesoverlap(self.absmin, self.absmax, it.absmin, it.absmax))
+                       {
+                               PlayerTouchExplode(self, it);
+                               self.touchexplode_time = it.touchexplode_time = time + 0.2;
+                       }
+               ));
 
        return false;
 }