From f395960adeea1f51f01ec8045d1e175926a6ea4a Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Mon, 15 May 2023 14:45:05 +0200 Subject: General code cleanups * Overall includes cleanup * Use std::make_pair * Make some functions const --- src/scripting/lua.cpp | 3 ++- src/scripting/luautil.cpp | 7 ++++--- src/scripting/scriptmanager.cpp | 1 + src/scripting/scriptmanager.h | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src/scripting') diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp index 8b92ecd4..ce2ee95f 100644 --- a/src/scripting/lua.cpp +++ b/src/scripting/lua.cpp @@ -24,7 +24,9 @@ #include "common/defines.h" #include "common/resourcemanager.h" +#include "game-server/abilitycomponent.h" #include "game-server/accountconnection.h" +#include "game-server/being.h" #include "game-server/buysell.h" #include "game-server/charactercomponent.h" #include "game-server/collisiondetection.h" @@ -50,7 +52,6 @@ #include "scripting/luascript.h" #include "scripting/scriptmanager.h" #include "utils/logger.h" -#include "utils/speedconv.h" #include #include diff --git a/src/scripting/luautil.cpp b/src/scripting/luautil.cpp index c737aad9..99b92960 100644 --- a/src/scripting/luautil.cpp +++ b/src/scripting/luautil.cpp @@ -23,11 +23,12 @@ #include -#include "game-server/charactercomponent.h" +#include "game-server/actorcomponent.h" +#include "game-server/being.h" +#include "game-server/entity.h" #include "game-server/itemmanager.h" #include "game-server/monster.h" #include "game-server/monstermanager.h" -#include "game-server/npc.h" #include "utils/logger.h" @@ -299,7 +300,7 @@ AbilityManager::AbilityInfo *checkAbility(lua_State *s, int p) AttributeInfo *checkAttribute(lua_State *s, int p) { - AttributeInfo *attributeInfo; + AttributeInfo *attributeInfo = nullptr; switch (lua_type(s, p)) { diff --git a/src/scripting/scriptmanager.cpp b/src/scripting/scriptmanager.cpp index 06b9b761..9abf3ebb 100644 --- a/src/scripting/scriptmanager.cpp +++ b/src/scripting/scriptmanager.cpp @@ -22,6 +22,7 @@ #include "common/configuration.h" #include "scripting/script.h" +#include "utils/logger.h" static Script *_currentState; diff --git a/src/scripting/scriptmanager.h b/src/scripting/scriptmanager.h index 293b1dab..0347774e 100644 --- a/src/scripting/scriptmanager.h +++ b/src/scripting/scriptmanager.h @@ -21,7 +21,8 @@ #ifndef SCRIPTMANAGER_H #define SCRIPTMANAGER_H -#include "game-server/charactercomponent.h" +#include "common/inventorydata.h" +#include "game-server/entity.h" #include -- cgit v1.2.3-70-g09d2