diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-03-05 20:53:18 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-03-07 22:10:00 +0100 |
commit | 99227026607ecfaca1ff07705930a83d41c16042 (patch) | |
tree | 49153afd9f05d65c2102ff974f763342eb59684e /src/scripting/luascript.h | |
parent | b0225ccd7997e900d4276eacc1541ec80fadbb48 (diff) | |
download | manaserv-99227026607ecfaca1ff07705930a83d41c16042.tar.gz manaserv-99227026607ecfaca1ff07705930a83d41c16042.tar.bz2 manaserv-99227026607ecfaca1ff07705930a83d41c16042.tar.xz manaserv-99227026607ecfaca1ff07705930a83d41c16042.zip |
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
Diffstat (limited to 'src/scripting/luascript.h')
-rw-r--r-- | src/scripting/luascript.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/scripting/luascript.h b/src/scripting/luascript.h index 6ea44bac..e26fd9ef 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(); |