summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/m_core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/MirLua/src/m_core.cpp')
-rw-r--r--plugins/MirLua/src/m_core.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/MirLua/src/m_core.cpp b/plugins/MirLua/src/m_core.cpp
index 6ec526101e..3b7e841c1e 100644
--- a/plugins/MirLua/src/m_core.cpp
+++ b/plugins/MirLua/src/m_core.cpp
@@ -360,6 +360,15 @@ static int core_TerminateThread(lua_State *L)
return 1;
}
+int core_ptr2number(lua_State *L)
+{
+ ObsoleteMethod(L, "Use tonumber(x) instead");
+
+ luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+ lua_pushnumber(L, (intptr_t)lua_touserdata(L, 1));
+ return 1;
+}
+
luaL_Reg coreApi[] =
{
{ "CreateHookableEvent", core_CreateHookableEvent },
@@ -389,7 +398,7 @@ luaL_Reg coreApi[] =
{ "ForkThread", core_ForkThread },
{ "TerminateThread", core_TerminateThread },
- { "PointerToNumber", luaM_ptr2number },
+ { "PointerToNumber", core_ptr2number },
{ "GetFullPath", core_GetFullPath },