summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/m_hotkeys.cpp
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2017-09-02 22:08:32 +0300
committeraunsane <aunsane@gmail.com>2017-09-02 22:08:57 +0300
commitbc4da963e5ebc651d1d7839a4da39ba59dfa4ea0 (patch)
tree9f3431f4ebf9688e76c99a4b357e120bfc0de284 /plugins/MirLua/src/m_hotkeys.cpp
parentbf3a7231bf7f977591c80a7dca44035dfbf9c376 (diff)
MirLua: small refactoring
Diffstat (limited to 'plugins/MirLua/src/m_hotkeys.cpp')
-rw-r--r--plugins/MirLua/src/m_hotkeys.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/plugins/MirLua/src/m_hotkeys.cpp b/plugins/MirLua/src/m_hotkeys.cpp
index 63358fd31c..2b2aed8c18 100644
--- a/plugins/MirLua/src/m_hotkeys.cpp
+++ b/plugins/MirLua/src/m_hotkeys.cpp
@@ -36,11 +36,7 @@ void MakeHotkey(lua_State *L, HOTKEYDESC &hk)
static int hotkeys_Register(lua_State *L)
{
- if (lua_type(L, 1) != LUA_TTABLE)
- {
- lua_pushlightuserdata(L, 0);
- return 1;
- }
+ luaL_checktype(L, 1, LUA_TTABLE);
HOTKEYDESC hk;
MakeHotkey(L, hk);
@@ -56,7 +52,9 @@ static int hotkeys_Register(lua_State *L)
static int hotkeys_Unregister(lua_State *L)
{
const char *name = luaL_checkstring(L, 1);
+
Hotkey_Unregister(name);
+
return 0;
}