From 0f538b8238a2c3e7133e187cce375c238c6ebee4 Mon Sep 17 00:00:00 2001 From: "p.kosyh" Date: Wed, 23 Jun 2010 17:25:23 +0000 Subject: [PATCH] goto form exit --- stead/goto.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stead/goto.lua b/stead/goto.lua index 92b2f2b..54a88d0 100644 --- a/stead/goto.lua +++ b/stead/goto.lua @@ -27,7 +27,7 @@ go = function (self, where, back) error ("Do not use goto from left/entered action! Use exit/enter action instead:" .. self.where); end - local v, r; + local v, r, jump; if not isVroom(ref(where)) and not stead.in_exit_call then stead.in_exit_call = true -- to break recurse @@ -36,6 +36,10 @@ go = function (self, where, back) if r == false then return v, ret(r) end + if self.where ~= was then + where = deref(self.where) -- jump + jump = true + end end local res = v; @@ -45,7 +49,7 @@ go = function (self, where, back) self.where = deref(where); end - if not back or not isDialog(ref(was)) or isDialog(ref(where)) then + if not jump and (not back or not isDialog(ref(was)) or isDialog(ref(where))) then v, r = call(ref(where), 'enter', deref(was)); if r == false then self.where = was;