From d858d88e7600d7e0cdef80e0cc9e9a76daffb277 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20K=C3=A4nner?= Date: Wed, 22 Jan 2025 00:42:55 +0100 Subject: [PATCH] fix health reset on feeding --- battlesnake/src/types/simulation.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/battlesnake/src/types/simulation.rs b/battlesnake/src/types/simulation.rs index d2d8397..1e3e174 100644 --- a/battlesnake/src/types/simulation.rs +++ b/battlesnake/src/types/simulation.rs @@ -458,12 +458,12 @@ impl Snake { pub fn advance(&mut self, head: Coord) { self.body.push_back(head); self.body.pop_front(); - self.health = 100; } pub fn feed(&mut self) { if let Some(tail) = self.body.front() { self.body.push_front(*tail); + self.health = 100; } } }