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.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/scripting/luascript.h') diff --git a/src/scripting/luascript.h b/src/scripting/luascript.h index 6ea44ba..e26fd9e 100644 --- a/src/scripting/luascript.h +++ b/src/scripting/luascript.h @@ -81,6 +81,8 @@ class LuaScript : public Script static void setRemoveNotificationCallback(Script *script) { script->assignCallback(mRemoveNotificationCallback); } + static const char registryKey; + private: lua_State *mState; int nbArgs; @@ -91,8 +93,6 @@ class LuaScript : public Script static Ref mRemoveNotificationCallback; }; -static char const registryKey = 0; - static Script *LuaFactory() { return new LuaScript(); -- cgit