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;