]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/touchexplode/touchexplode.qc
Simplify progs.inc
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / touchexplode / touchexplode.qc
index ec439489d0de383c50681330fc4225a56c62c600..56fc4573673eeac551f5b49d4cca1ed5e467b824 100644 (file)
@@ -26,22 +26,21 @@ MUTATOR_HOOKFUNCTION(touchexplode, PlayerPreThink)
 {SELFPARAM();
        if(time > self.touchexplode_time)
        if(!gameover)
-       if(!self.frozen)
+       if(!STAT(FROZEN, self))
        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_DEAD(self))
+       if(!IS_INDEPENDENT_PLAYER(self))
+               FOREACH_CLIENT(IS_PLAYER(it) && it != self, LAMBDA(
+                       if(time > it.touchexplode_time)
+                       if(!STAT(FROZEN, it))
+                       if(!IS_DEAD(it))
+                       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;
 }