]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/touchexplode/sv_touchexplode.qc
Merge branch 'master' into martin-t/dmgtext
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / touchexplode / sv_touchexplode.qc
index 38ac30595dad46fd76695c959f11863898c94876..6be2c5963b69f4515b05b97be642e82b4b18560b 100644 (file)
@@ -1,11 +1,12 @@
 #include "sv_touchexplode.qh"
 
+string autocvar_g_touchexplode;
 float autocvar_g_touchexplode_radius;
 float autocvar_g_touchexplode_damage;
 float autocvar_g_touchexplode_edgedamage;
 float autocvar_g_touchexplode_force;
 
-REGISTER_MUTATOR(touchexplode, cvar("g_touchexplode"));
+REGISTER_MUTATOR(touchexplode, expr_evaluate(autocvar_g_touchexplode));
 
 .float touchexplode_time;
 
@@ -19,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,12 +29,12 @@ MUTATOR_HOOKFUNCTION(touchexplode, PlayerPreThink)
        entity player = M_ARGV(0, entity);
 
        if(time > player.touchexplode_time)
-       if(!gameover)
+       if(!game_stopped)
        if(!STAT(FROZEN, player))
        if(IS_PLAYER(player))
        if(!IS_DEAD(player))
        if(!IS_INDEPENDENT_PLAYER(player))
-               FOREACH_CLIENT(IS_PLAYER(it) && it != player, LAMBDA(
+               FOREACH_CLIENT(IS_PLAYER(it) && it != player, {
                        if(time > it.touchexplode_time)
                        if(!STAT(FROZEN, it))
                        if(!IS_DEAD(it))
@@ -43,5 +44,5 @@ MUTATOR_HOOKFUNCTION(touchexplode, PlayerPreThink)
                                PlayerTouchExplode(player, it);
                                player.touchexplode_time = it.touchexplode_time = time + 0.2;
                        }
-               ));
+               });
 }