From d5ed3f97485ca45643ba38c1573f4cb98763aaf9 Mon Sep 17 00:00:00 2001 From: "p.kosyh" Date: Wed, 23 Jun 2010 12:02:04 +0000 Subject: [PATCH] more clever goto from life --- stead/stead.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/stead/stead.lua b/stead/stead.lua index 5295855..25191b3 100644 --- a/stead/stead.lua +++ b/stead/stead.lua @@ -1244,21 +1244,22 @@ function game_life(self) local av,v stead.in_life_call = true; stead.lifes_off = list {}; -- lifes to off - + local m = PLAYER_MOVED for i,o in opairs(self.lifes) do local vv local pre o = ref(o); if not isDisabled(o) then - local m = PLAYER_MOVED + PLAYER_MOVED = false vv,pre = call(o,'life'); - if pre or (m ~= PLAYER_MOVED and pre ~= false) then + if pre or (PLAYER_MOVED and pre ~= false) then av = stead.par(' ', av, vv); else v = stead.par(' ',v, vv); end end - end + end + if not PLAYER_MOVED then PLAYER_MOVED = m end stead.in_life_call = false; for i,o in ipairs(stead.lifes_off) do lifeoff(o);