From fec92c30006d82c1a9e204ab09e84d489eb40264 Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 12 Sep 2021 12:23:53 -0400 Subject: [PATCH] Fixed plugin tests with hack. --- common/src/comp/health.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/common/src/comp/health.rs b/common/src/comp/health.rs index 93e1bfefd1..193cb64a56 100644 --- a/common/src/comp/health.rs +++ b/common/src/comp/health.rs @@ -134,6 +134,23 @@ impl Health { self.current = self.maximum; self.is_dead = false; } + + // Function only exists for plugin tests, do not use anywhere else + // TODO: Remove somehow later + #[deprecated] + pub fn empty() -> Self { + Health { + current: 0, + base_max: 0, + maximum: 0, + last_change: (0.0, HealthChange { + amount: 0.0, + by: None, + cause: None, + }), + is_dead: false, + } + } } #[cfg(not(target_arch = "wasm32"))]