From b0b7ad08a3f1886efb1784f72a2ccec14606bf5c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Fri, 1 Jan 2016 18:06:34 -0500 Subject: [PATCH] contrib/tinks: do not publish TankMoveEvents for dead tanks MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- contrib/tinks/src/game/tanks.nit | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/tinks/src/game/tanks.nit b/contrib/tinks/src/game/tanks.nit index 9d82965..1289415 100644 --- a/contrib/tinks/src/game/tanks.nit +++ b/contrib/tinks/src/game/tanks.nit @@ -94,7 +94,9 @@ class Tank turret.do_turn turn - turn.add new TankMoveEvent(self, pos, direction_heading, direction_forwards, heading, turret.relative_heading) + if health > 0 then + turn.add new TankMoveEvent(self, pos, direction_heading, direction_forwards, heading, turret.relative_heading) + end end # What would be the next position if not blocked by terrain features? -- 1.7.9.5