Allow turning off damage from lava and slime in instagib, as it used to be
authorMario <zacjardine@y7mail.com>
Sun, 30 Aug 2015 12:24:35 +0000 (22:24 +1000)
committerMario <zacjardine@y7mail.com>
Sun, 30 Aug 2015 12:24:35 +0000 (22:24 +1000)
mutators.cfg
qcsrc/server/autocvars.qh
qcsrc/server/mutators/mutator_instagib.qc

index 311debc..10a41a0 100644 (file)
@@ -31,6 +31,7 @@ set g_instagib_ammo_start 10 "starting ammo"
 set g_instagib_ammo_drop 5 "how much ammo you'll get for weapons or cells"
 set g_instagib_invis_alpha 0.15
 set g_instagib_speed_highspeed 1.5 "speed-multiplier that applies while you carry the invincibility powerup"
+set g_instagib_damagedbycontents 1 "allow damage from lava pits in instagib"
 
 
 // ==========
index 3f4a11a..3783ee4 100644 (file)
@@ -402,6 +402,7 @@ int autocvar_g_instagib_ammo_drop;
 int autocvar_g_instagib_extralives;
 float autocvar_g_instagib_speed_highspeed;
 float autocvar_g_instagib_invis_alpha;
+bool autocvar_g_instagib_damagedbycontents = true;
 #define autocvar_g_mirrordamage cvar("g_mirrordamage")
 #define autocvar_g_mirrordamage_virtual cvar("g_mirrordamage_virtual")
 
index 9728ed6..2e76d70 100644 (file)
@@ -249,12 +249,17 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerDamage)
 
        if(IS_PLAYER(frag_target))
        {
-               if ((frag_deathtype == DEATH_FALL)  ||
-                       (frag_deathtype == DEATH_DROWN) ||
-                       (frag_deathtype == DEATH_SLIME) ||
-                       (frag_deathtype == DEATH_LAVA))
+               if(frag_deathtype == DEATH_FALL)
+                       frag_damage = 0; // never count fall damage
+
+               if(!autocvar_g_instagib_damagedbycontents)
+               switch(frag_deathtype)
                {
-                       frag_damage = 0;
+                       case DEATH_DROWN:
+                       case DEATH_SLIME:
+                       case DEATH_LAVA:
+                               frag_damage = 0;
+                               break;
                }
 
                if(IS_PLAYER(frag_attacker))
@@ -335,11 +340,13 @@ MUTATOR_HOOKFUNCTION(instagib_FilterItem)
 
        if(self.weapon == WEP_DEVASTATOR.m_id || self.weapon == WEP_VORTEX.m_id)
        {
-               entity e = spawn();
+               entity e = spawn(), oldself;
                setorigin(e, self.origin);
-               entity oldself;
                oldself = self;
                self = e;
+               self.noalign = oldself.noalign;
+               self.cnt = oldself.cnt;
+               self.team = oldself.team;
                spawnfunc_item_minst_cells();
                self = oldself;
                return true;