From 99227026607ecfaca1ff07705930a83d41c16042 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Mon, 5 Mar 2012 20:53:18 +0100 Subject: Added a function that returns the current map or raises an error The new function 'checkCurrentMap' will raise an error when no current map has been set, eliminating the need to do custom error handling all over the place. This also fixes several functions that would otherwise have simply crashed when there was no current map. Also cleaned up some "empty string parameter" checks. Reviewed-by: Erik Schilling --- src/scripting/luascript.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/scripting/luascript.cpp') diff --git a/src/scripting/luascript.cpp b/src/scripting/luascript.cpp index 231dece..c9337d5 100644 --- a/src/scripting/luascript.cpp +++ b/src/scripting/luascript.cpp @@ -35,6 +35,8 @@ Script::Ref LuaScript::mPostReplyCallback; Script::Ref LuaScript::mDeathNotificationCallback; Script::Ref LuaScript::mRemoveNotificationCallback; +const char LuaScript::registryKey = 0; + LuaScript::~LuaScript() { lua_close(mState); -- cgit