From: Alexis Laferrière Date: Fri, 1 Jan 2016 23:06:34 +0000 (-0500) Subject: contrib/tinks: do not publish TankMoveEvents for dead tanks X-Git-Tag: v0.8~7^2~3 X-Git-Url: http://nitlanguage.org contrib/tinks: do not publish TankMoveEvents for dead tanks Signed-off-by: Alexis Laferrière --- 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?