]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Respawn frozen players in a safe spot as soon as they touch lava/slime (obbey g_froze...
authorterencehill <piuntn@gmail.com>
Wed, 13 May 2020 20:02:53 +0000 (22:02 +0200)
committerterencehill <piuntn@gmail.com>
Wed, 13 May 2020 20:02:53 +0000 (22:02 +0200)
qcsrc/server/g_damage.qc
qcsrc/server/sv_main.qc
xonotic-server.cfg

index ac38e645b3e994ea2c5292fe5e3bfc5811d8e8dd..84ae1279d19b288a5b1121d28e7115dac9b531ef 100644 (file)
@@ -683,7 +683,8 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de
                    }
                }
 
-               if(deathtype != DEATH_HURTTRIGGER.m_id && deathtype != DEATH_TEAMCHANGE.m_id && deathtype != DEATH_AUTOTEAMCHANGE.m_id && STAT(FROZEN, targ))
+               if(STAT(FROZEN, targ) && !ITEM_DAMAGE_NEEDKILL(deathtype)
+                       && deathtype != DEATH_TEAMCHANGE.m_id && deathtype != DEATH_AUTOTEAMCHANGE.m_id)
                {
                        if(autocvar_g_frozen_revive_falldamage > 0 && deathtype == DEATH_FALL.m_id && damage >= autocvar_g_frozen_revive_falldamage)
                        {
@@ -698,12 +699,12 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de
                        force *= autocvar_g_frozen_force;
                }
 
-               if(IS_PLAYER(targ) && STAT(FROZEN, targ) && deathtype == DEATH_HURTTRIGGER.m_id && !autocvar_g_frozen_damage_trigger)
+               if(IS_PLAYER(targ) && STAT(FROZEN, targ)
+                       && ITEM_DAMAGE_NEEDKILL(deathtype) && !autocvar_g_frozen_damage_trigger)
                {
                        Send_Effect(EFFECT_TELEPORT, targ.origin, '0 0 0', 1);
 
-                       entity spot = SelectSpawnPoint (targ, false);
-
+                       entity spot = SelectSpawnPoint(targ, false);
                        if(spot)
                        {
                                damage = 0;
index 2f2de95b38f0e772b0cdb7023c698fc2cdc27c9f..531a1537bf14a6efa183f66fc82a60bbe84cc5a4 100644 (file)
@@ -46,7 +46,14 @@ void CreatureFrame_hotliquids(entity this)
        }
        else
        {
-               if (this.watertype == CONTENT_LAVA)
+               if (STAT(FROZEN, this))
+               {
+                       if (this.watertype == CONTENT_LAVA)
+                               Damage(this, NULL, NULL, 10000, DEATH_LAVA.m_id, DMG_NOWEP, this.origin, '0 0 0');
+                       else if (this.watertype == CONTENT_SLIME)
+                               Damage(this, NULL, NULL, 10000, DEATH_SLIME.m_id, DMG_NOWEP, this.origin, '0 0 0');
+               }
+               else if (this.watertype == CONTENT_LAVA)
                {
                        if (this.watersound_finished < time)
                        {
index 187de7e364460e5e81c60b2726f6fd4c1f2cca8f..4fd599567007c6f55371e22293be76c4cca36ed1 100644 (file)
@@ -533,7 +533,7 @@ alias g_forced_team_matchsetup "map $1; settemp g_forced_team_red \"$2\"; settem
 // frozen
 set g_frozen_revive_falldamage 0 "Enable reviving from this amount of fall damage"
 set g_frozen_revive_falldamage_health 40 "Amount of health player has if they revived from falling"
-set g_frozen_damage_trigger 1 "if 1, frozen players falling into the void will die instead of teleporting to spawn"
+set g_frozen_damage_trigger 1 "if 1, frozen players falling into the void/lava/slime will die instead of teleporting to spawn"
 set g_frozen_force 0.6 "How much to multiply the force on a frozen player with"
 
 // player statistics