mirror of
https://github.com/vrld/hump.git
synced 2024-11-23 12:24:19 +00:00
(Fix #34) Add callback for returning from push()/pop()
state:resume() will be called on the state that issued a GS.push() after the pushed state is popped from the stack.
This commit is contained in:
parent
e10fa66e60
commit
bd10ec4caf
@ -57,7 +57,8 @@ function GS.pop()
|
|||||||
assert(#stack > 1, "No more states to pop!")
|
assert(#stack > 1, "No more states to pop!")
|
||||||
local pre = stack[#stack]
|
local pre = stack[#stack]
|
||||||
stack[#stack] = nil
|
stack[#stack] = nil
|
||||||
return (pre.leave or __NULL__)(pre)
|
;(pre.leave or __NULL__)(pre)
|
||||||
|
return (stack[#stack].resume or __NULL__)(pre)
|
||||||
end
|
end
|
||||||
|
|
||||||
function GS.current()
|
function GS.current()
|
||||||
|
Loading…
Reference in New Issue
Block a user