aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_base.h
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2020-11-04 16:57:41 +0100
committerElias Fleckenstein <eliasfleckenstein@web.de>2020-11-04 16:57:41 +0100
commit6ccb5835ff55d85156be91473c598eca9d6cb9a6 (patch)
tree7f1eaf8b94694c8e24e206909ba8f55a1ebfbb3e /src/script/lua_api/l_base.h
parent244713971a976e43e8740b6a9d9d122e37020ef2 (diff)
downloaddragonfireclient-6ccb5835ff55d85156be91473c598eca9d6cb9a6.tar.xz
Revert "Make Lint Happy"
This reverts commit ad148587dcf5244c2d2011dba339786c765c54c4.
Diffstat (limited to 'src/script/lua_api/l_base.h')
-rw-r--r--src/script/lua_api/l_base.h39
1 files changed, 19 insertions, 20 deletions
diff --git a/src/script/lua_api/l_base.h b/src/script/lua_api/l_base.h
index bb806d631..0cbee7756 100644
--- a/src/script/lua_api/l_base.h
+++ b/src/script/lua_api/l_base.h
@@ -41,44 +41,43 @@ class Server;
class Environment;
class ServerInventoryManager;
-class ModApiBase : protected LuaHelper
-{
+class ModApiBase : protected LuaHelper {
public:
- static ScriptApiBase *getScriptApiBase(lua_State *L);
- static Server *getServer(lua_State *L);
+ static ScriptApiBase* getScriptApiBase(lua_State *L);
+ static Server* getServer(lua_State *L);
static ServerInventoryManager *getServerInventoryMgr(lua_State *L);
-#ifndef SERVER
- static Client *getClient(lua_State *L);
- static Game *getGame(lua_State *L);
- static GUIEngine *getGuiEngine(lua_State *L);
-#endif // !SERVER
+ #ifndef SERVER
+ static Client* getClient(lua_State *L);
+ static Game* getGame(lua_State *L);
+ static GUIEngine* getGuiEngine(lua_State *L);
+ #endif // !SERVER
- static IGameDef *getGameDef(lua_State *L);
- static Environment *getEnv(lua_State *L);
+ static IGameDef* getGameDef(lua_State *L);
+ static Environment* getEnv(lua_State *L);
// When we are not loading the mod, this function returns "."
- static std::string getCurrentModPath(lua_State *L);
+ static std::string getCurrentModPath(lua_State *L);
// Get an arbitrary subclass of ScriptApiBase
// by using dynamic_cast<> on getScriptApiBase()
- template <typename T> static T *getScriptApi(lua_State *L)
- {
+ template<typename T>
+ static T* getScriptApi(lua_State *L) {
ScriptApiBase *scriptIface = getScriptApiBase(L);
- T *scriptIfaceDowncast = dynamic_cast<T *>(scriptIface);
+ T *scriptIfaceDowncast = dynamic_cast<T*>(scriptIface);
if (!scriptIfaceDowncast) {
- throw LuaError("Requested unavailable ScriptApi - core engine "
- "bug!");
+ throw LuaError("Requested unavailable ScriptApi - core engine bug!");
}
return scriptIfaceDowncast;
}
- static bool registerFunction(
- lua_State *L, const char *name, lua_CFunction func, int top);
+ static bool registerFunction(lua_State *L,
+ const char* name,
+ lua_CFunction func,
+ int top);
static int l_deprecated_function(lua_State *L);
static void markAliasDeprecated(luaL_Reg *reg);
-
private:
// <old_name> = { <new_name>, <new_function> }
static std::unordered_map<std::string, luaL_Reg> m_deprecated_wrappers;