From f9af83461314fa9ca416bdee7c97dabcab2c5e2c Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Sat, 9 Nov 2024 19:34:09 -0300 Subject: [PATCH] improve: fix circular dependencies in weapons.hpp --- src/creatures/combat/combat.cpp | 1 + src/items/weapons/weapons.cpp | 2 +- src/items/weapons/weapons.hpp | 1 - src/lua/functions/core/game/game_functions.cpp | 1 + src/lua/functions/core/game/global_functions.cpp | 1 + src/lua/functions/creatures/combat/combat_functions.cpp | 1 + 6 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/creatures/combat/combat.cpp b/src/creatures/combat/combat.cpp index a63f42093db..6dcd0f229b3 100644 --- a/src/creatures/combat/combat.cpp +++ b/src/creatures/combat/combat.cpp @@ -27,6 +27,7 @@ #include "lua/callbacks/events_callbacks.hpp" #include "lua/creature/events.hpp" #include "map/spectators.hpp" +#include "creatures/players/player.hpp" int32_t Combat::getLevelFormula(const std::shared_ptr &player, const std::shared_ptr &wheelSpell, const CombatDamage &damage) const { if (!player) { diff --git a/src/items/weapons/weapons.cpp b/src/items/weapons/weapons.cpp index 81e59f6a739..f27732f3b59 100644 --- a/src/items/weapons/weapons.cpp +++ b/src/items/weapons/weapons.cpp @@ -13,8 +13,8 @@ #include "creatures/combat/combat.hpp" #include "game/game.hpp" #include "lua/creature/events.hpp" - #include "lua/global/lua_variant.hpp" +#include "creatures/players/player.hpp" Weapons::Weapons() = default; Weapons::~Weapons() = default; diff --git a/src/items/weapons/weapons.hpp b/src/items/weapons/weapons.hpp index bbe15e12a7d..c31813d09e0 100644 --- a/src/items/weapons/weapons.hpp +++ b/src/items/weapons/weapons.hpp @@ -10,7 +10,6 @@ #pragma once #include "lua/scripts/luascript.hpp" -#include "creatures/players/player.hpp" #include "lua/scripts/scripts.hpp" #include "creatures/combat/combat.hpp" #include "utils/utils_definitions.hpp" diff --git a/src/lua/functions/core/game/game_functions.cpp b/src/lua/functions/core/game/game_functions.cpp index f1445b628b6..f1226d2e22c 100644 --- a/src/lua/functions/core/game/game_functions.cpp +++ b/src/lua/functions/core/game/game_functions.cpp @@ -28,6 +28,7 @@ #include "lua/functions/events/event_callback_functions.hpp" #include "lua/scripts/lua_environment.hpp" #include "map/spectators.hpp" +#include "creatures/players/player.hpp" // Game int GameFunctions::luaGameCreateMonsterType(lua_State* L) { diff --git a/src/lua/functions/core/game/global_functions.cpp b/src/lua/functions/core/game/global_functions.cpp index 14d87e5afb2..6befdc5eb67 100644 --- a/src/lua/functions/core/game/global_functions.cpp +++ b/src/lua/functions/core/game/global_functions.cpp @@ -22,6 +22,7 @@ #include "lua/scripts/lua_environment.hpp" #include "lua/scripts/script_environment.hpp" #include "server/network/protocol/protocolstatus.hpp" +#include "creatures/players/player.hpp" void GlobalFunctions::init(lua_State* L) { lua_register(L, "addEvent", GlobalFunctions::luaAddEvent); diff --git a/src/lua/functions/creatures/combat/combat_functions.cpp b/src/lua/functions/creatures/combat/combat_functions.cpp index 27d3a76ef04..e07bce7a7f0 100644 --- a/src/lua/functions/creatures/combat/combat_functions.cpp +++ b/src/lua/functions/creatures/combat/combat_functions.cpp @@ -14,6 +14,7 @@ #include "game/game.hpp" #include "lua/global/lua_variant.hpp" #include "lua/scripts/lua_environment.hpp" +#include "creatures/players/player.hpp" int CombatFunctions::luaCombatCreate(lua_State* L) { // Combat()