mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
love.event.quit now accepts a single (optional) argument, which is used as the program's exit status number. Resolves issue #1070.
This commit is contained in:
@@ -97,9 +97,19 @@ int w_clear(lua_State *)
|
||||
|
||||
int w_quit(lua_State *L)
|
||||
{
|
||||
Message *m = new Message("quit");
|
||||
std::vector<StrongRef<Variant>> args;
|
||||
|
||||
Variant *v = Variant::fromLua(L, 1);
|
||||
if (v)
|
||||
{
|
||||
args.push_back(v);
|
||||
v->release();
|
||||
}
|
||||
|
||||
Message *m = new Message("quit", args);
|
||||
instance()->push(m);
|
||||
m->release();
|
||||
|
||||
luax_pushboolean(L, true);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user