]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/touchexplode/sv_touchexplode.qc
Merge branch 't0uYK8Ne/set_slick_friction' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / touchexplode / sv_touchexplode.qc
index a1b38fb6e750a2a44b6638189b6d18f3d89a3f0d..5d46a9edf0d0f732ca49373acdbc2feed4245512 100644 (file)
@@ -20,7 +20,7 @@ void PlayerTouchExplode(entity p1, entity p2)
 
        entity e = spawn();
        setorigin(e, org);
-       RadiusDamage(e, NULL, autocvar_g_touchexplode_damage, autocvar_g_touchexplode_edgedamage, autocvar_g_touchexplode_radius, NULL, NULL, autocvar_g_touchexplode_force, DEATH_TOUCHEXPLODE.m_id, NULL);
+       RadiusDamage(e, NULL, autocvar_g_touchexplode_damage, autocvar_g_touchexplode_edgedamage, autocvar_g_touchexplode_radius, NULL, NULL, autocvar_g_touchexplode_force, DEATH_TOUCHEXPLODE.m_id, DMG_NOWEP, NULL);
        delete(e);
 }
 
@@ -28,21 +28,15 @@ MUTATOR_HOOKFUNCTION(touchexplode, PlayerPreThink)
 {
        entity player = M_ARGV(0, entity);
 
-       if(time > player.touchexplode_time)
-       if(!game_stopped)
-       if(!STAT(FROZEN, player))
-       if(IS_PLAYER(player))
-       if(!IS_DEAD(player))
-       if(!IS_INDEPENDENT_PLAYER(player))
+       if(time > player.touchexplode_time && !game_stopped && !IS_DEAD(player) && IS_PLAYER(player) && !STAT(FROZEN, player) && !IS_INDEPENDENT_PLAYER(player))
+       {
                FOREACH_CLIENT(IS_PLAYER(it) && it != player, {
-                       if(time > it.touchexplode_time)
-                       if(!STAT(FROZEN, it))
-                       if(!IS_DEAD(it))
-                       if (!IS_INDEPENDENT_PLAYER(it))
+                       if(time > it.touchexplode_time && !STAT(FROZEN, it) && !IS_DEAD(it) && !IS_INDEPENDENT_PLAYER(it))
                        if(boxesoverlap(player.absmin, player.absmax, it.absmin, it.absmax))
                        {
                                PlayerTouchExplode(player, it);
                                player.touchexplode_time = it.touchexplode_time = time + 0.2;
                        }
                });
+       }
 }