From: Mario Date: Sun, 30 Aug 2015 12:24:35 +0000 (+1000) Subject: Allow turning off damage from lava and slime in instagib, as it used to be X-Git-Tag: xonotic-v0.8.2~1958 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2671dcbe85ad0122d0ab0fe63c73443ab5ccf6d1;p=xonotic%2Fxonotic-data.pk3dir.git Allow turning off damage from lava and slime in instagib, as it used to be --- diff --git a/mutators.cfg b/mutators.cfg index 311debc2c..10a41a069 100644 --- a/mutators.cfg +++ b/mutators.cfg @@ -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" // ========== diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index 3f4a11a7c..3783ee419 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -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") diff --git a/qcsrc/server/mutators/mutator_instagib.qc b/qcsrc/server/mutators/mutator_instagib.qc index 9728ed623..2e76d700e 100644 --- a/qcsrc/server/mutators/mutator_instagib.qc +++ b/qcsrc/server/mutators/mutator_instagib.qc @@ -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;