From: terencehill Date: Wed, 13 May 2020 20:02:53 +0000 (+0200) Subject: Respawn frozen players in a safe spot as soon as they touch lava/slime (obbey g_froze... X-Git-Tag: xonotic-v0.8.5~1075 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b66a712bdc192f024667105a5636972ed7a087d8;p=xonotic%2Fxonotic-data.pk3dir.git Respawn frozen players in a safe spot as soon as they touch lava/slime (obbey g_frozen_damage_trigger cvar) --- diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index ac38e645b..84ae1279d 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -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; diff --git a/qcsrc/server/sv_main.qc b/qcsrc/server/sv_main.qc index 2f2de95b3..531a1537b 100644 --- a/qcsrc/server/sv_main.qc +++ b/qcsrc/server/sv_main.qc @@ -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) { diff --git a/xonotic-server.cfg b/xonotic-server.cfg index 187de7e36..4fd599567 100644 --- a/xonotic-server.cfg +++ b/xonotic-server.cfg @@ -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