From ece7a5e46a92a5cbf88bb72892dfc67dba059859 Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Wed, 21 Jan 2009 22:27:35 +0100 Subject: Added script command to get the id of the current map (requested by Invertika). --- src/scripting/lua.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/scripting/lua.cpp') diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp index aead80cb..e711623d 100644 --- a/src/scripting/lua.cpp +++ b/src/scripting/lua.cpp @@ -1151,6 +1151,18 @@ static int LuaTest_Tableget(lua_State *s) return 4; } +/** + * Returns the ID of the current map + */ +static int LuaGet_MapId(lua_State *s) +{ + lua_pushlightuserdata(s, (void *)®istryKey); + lua_gettable(s, LUA_REGISTRYINDEX); + Script *t = static_cast