summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/m_core.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_core.cpp
parentbf3a7231bf7f977591c80a7dca44035dfbf9c376 (diff)
MirLua: small refactoring
Diffstat (limited to 'plugins/MirLua/src/m_core.cpp')
-rw-r--r--plugins/MirLua/src/m_core.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/plugins/MirLua/src/m_core.cpp b/plugins/MirLua/src/m_core.cpp
index 46d6c50c8b..c58ce9cf1f 100644
--- a/plugins/MirLua/src/m_core.cpp
+++ b/plugins/MirLua/src/m_core.cpp
@@ -5,14 +5,11 @@ static int core_CreateHookableEvent(lua_State *L)
const char *name = luaL_checkstring(L, 1);
HANDLE res = CreateHookableEvent(name);
- if (res == NULL)
- {
+ if (res != nullptr)
+ lua_pushlightuserdata(L, res);
+ else
lua_pushnil(L);
- return 1;
- }
- lua_pushlightuserdata(L, res);
-
return 1;
}