Fixed oxygen-depleting status effects being able to kill characters that don't need oxygen

This commit is contained in:
Joonas Rikkonen
2018-11-19 20:24:11 +02:00
parent b3a1d2f75f
commit 9e97b4828f

View File

@@ -313,7 +313,7 @@ namespace Barotrauma
get { return oxygen; }
set
{
if (!MathUtils.IsValid(value)) return;
if (!MathUtils.IsValid(value) || !needsAir) return;
oxygen = MathHelper.Clamp(value, -100.0f, 100.0f);
if (oxygen == -100.0f) Kill(AnimController.InWater ? CauseOfDeath.Drowning : CauseOfDeath.Suffocation);
}