mirror of
https://github.com/love2d/love.git
synced 2026-08-20 20:49:54 +02:00
Add love.event.restart(optionalvalue) as a shorthand for love.event.quit("restart", optionalvalue). If a Lua value is provided as an argument, a new love.restart field will contain the value after restarting.
--HG-- branch : minor
This commit is contained in:
@@ -598,7 +598,7 @@ function love.run()
|
||||
for name, a,b,c,d,e,f in love.event.poll() do
|
||||
if name == "quit" then
|
||||
if not love.quit or not love.quit() then
|
||||
return a or 0
|
||||
return a or 0, b
|
||||
end
|
||||
end
|
||||
love.handlers[name](a,b,c,d,e,f)
|
||||
@@ -799,8 +799,8 @@ return function()
|
||||
func = earlyinit
|
||||
|
||||
while func do
|
||||
local _, retval = xpcall(func, deferErrhand)
|
||||
if retval then return retval end
|
||||
local _, retval, restartvalue = xpcall(func, deferErrhand)
|
||||
if retval then return retval, restartvalue end
|
||||
coroutine.yield()
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user