]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't enable the oxygen bar when frozen or in lava/slime; also fix the oxygen bar...
authorterencehill <piuntn@gmail.com>
Tue, 12 May 2020 19:32:25 +0000 (21:32 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 12 May 2020 19:32:25 +0000 (21:32 +0200)
qcsrc/server/client.qc
qcsrc/server/sv_main.qc

index bb92c6ba066ee3a25b809fa9d79d76dfc9967ef7..e60c2ab637ca3622ac015421f6f869057b82294a 100644 (file)
@@ -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);
index 3aef76e49a22074a71285ee56f29129b1799a103..2f2de95b38f0e772b0cdb7023c698fc2cdc27c9f 100644 (file)
@@ -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;
        }
 }