mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Make c2.register_command() return a boolean if it went ok
This commit is contained in:
parent
52832b43e5
commit
9da3a33e1c
1 changed files with 3 additions and 2 deletions
|
@ -304,12 +304,13 @@ int luaC2RegisterCommand(lua_State *L)
|
||||||
|
|
||||||
auto callbackSavedName = QString("c2commandcb-%1").arg(name);
|
auto callbackSavedName = QString("c2commandcb-%1").arg(name);
|
||||||
lua_setfield(L, LUA_REGISTRYINDEX, callbackSavedName.toStdString().c_str());
|
lua_setfield(L, LUA_REGISTRYINDEX, callbackSavedName.toStdString().c_str());
|
||||||
pl->registerCommand(name, callbackSavedName);
|
auto ok = pl->registerCommand(name, callbackSavedName);
|
||||||
|
|
||||||
// delete both name and callback
|
// delete both name and callback
|
||||||
lua_pop(L, 2);
|
lua_pop(L, 2);
|
||||||
|
|
||||||
return 0;
|
lua::push(L, ok);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
int luaC2SendMsg(lua_State *L)
|
int luaC2SendMsg(lua_State *L)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue