From: terencehill Date: Tue, 12 May 2020 19:32:25 +0000 (+0200) Subject: Don't enable the oxygen bar when frozen or in lava/slime; also fix the oxygen bar... X-Git-Tag: xonotic-v0.8.5~1077 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=3e6135ee697de27a159f611f6d755c27921e4019;hp=cbaaedf5e63f6f24948c6f83d302c9ea9125a32c Don't enable the oxygen bar when frozen or in lava/slime; also fix the oxygen bar appearing when spectating a player in shallow water --- diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index bb92c6ba06..e60c2ab637 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -2606,10 +2606,14 @@ void PlayerPreThink (entity this) void DrownPlayer(entity this) { - if(IS_DEAD(this) || game_stopped || time < game_starttime) + if(IS_DEAD(this) || game_stopped || time < game_starttime || this.vehicle + || STAT(FROZEN, this) || this.watertype != CONTENT_WATER) + { + this.air_finished = 0; return; + } - if (this.waterlevel != WATERLEVEL_SUBMERGED || this.vehicle) + if (this.waterlevel != WATERLEVEL_SUBMERGED) { if(this.air_finished && this.air_finished < time) PlayerSound(this, playersound_gasp, CH_PLAYER, VOL_BASE, VOICETYPE_PLAYERSOUND); diff --git a/qcsrc/server/sv_main.qc b/qcsrc/server/sv_main.qc index 3aef76e49a..2f2de95b38 100644 --- a/qcsrc/server/sv_main.qc +++ b/qcsrc/server/sv_main.qc @@ -80,8 +80,6 @@ void CreatureFrame_Liquids(entity this) } CreatureFrame_hotliquids(this); - if (!this.air_finished) - this.air_finished = time + autocvar_g_balance_contents_drowndelay; } else { @@ -91,7 +89,6 @@ void CreatureFrame_Liquids(entity this) this.flags &= ~FL_INWATER; this.dmgtime = 0; } - this.air_finished = 0; } }