]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 311debc2c0aa19595eddf24cea5bd1e31f0b8820..10a41a06935c10103656b70dffa4d243a683a7c4 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 3f4a11a7cefe2125d5b777e03cf5f3106f2bbecc..3783ee41953598cb2e6f5ae22810a1fc74c40582 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 9728ed623b2f150b06137a97e5528053a999b976..2e76d700e1c2b5c44a863490a8d848a6b37f0c7e 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;