From c38fcaa8dd3022dc56c70302159b08b8b282bea7 Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 8 May 2024 00:32:20 +0200 Subject: [PATCH] clamp suit integrity at 0%-100% --- src/actor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/actor.rs b/src/actor.rs index f74a01f..0f6903c 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -405,7 +405,7 @@ fn handle_collisions( if *entity1 == player || *entity2 == player { ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Crash)); lifeform.adrenaline_jolt += 0.1; - suit.integrity -= 0.03; + suit.integrity = (suit.integrity - 0.03).max(0.0); } } }