From fe4113d086707dfb0c5b214d9126f5ddb5b20678 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 19 Sep 2024 00:06:02 +0000 Subject: [PATCH] Code format - (Clang-format) --- src/creatures/players/player.hpp | 2 +- src/items/containers/mailbox/mailbox.cpp | 2 +- src/items/cylinder.hpp | 2 +- src/items/items_classification.hpp | 2 +- src/items/weapons/weapons.hpp | 2 +- src/lua/creature/events.cpp | 2 +- src/lua/functions/core/game/global_functions.cpp | 2 +- src/server/network/message/networkmessage.cpp | 4 ++-- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/creatures/players/player.hpp b/src/creatures/players/player.hpp index 1c15e32d449..a7df17c807c 100644 --- a/src/creatures/players/player.hpp +++ b/src/creatures/players/player.hpp @@ -2699,7 +2699,7 @@ class Player final : public Creature, public Cylinder, public Bankable { ReturnValue queryRemove(const std::shared_ptr &thing, uint32_t count, uint32_t flags, const std::shared_ptr &actor = nullptr) override; std::shared_ptr queryDestination(int32_t &index, const std::shared_ptr &thing, std::shared_ptr &destItem, uint32_t &flags) override; - void addThing(const std::shared_ptr&) override { } + void addThing(const std::shared_ptr &) override { } void addThing(int32_t index, const std::shared_ptr &thing) override; void updateThing(const std::shared_ptr &thing, uint16_t itemId, uint32_t count) override; diff --git a/src/items/containers/mailbox/mailbox.cpp b/src/items/containers/mailbox/mailbox.cpp index f6c42f45adf..5be97649f36 100644 --- a/src/items/containers/mailbox/mailbox.cpp +++ b/src/items/containers/mailbox/mailbox.cpp @@ -32,7 +32,7 @@ ReturnValue Mailbox::queryRemove(const std::shared_ptr &, uint32_t, uint3 return RETURNVALUE_NOTPOSSIBLE; } -std::shared_ptr Mailbox::queryDestination(int32_t &, const std::shared_ptr &, std::shared_ptr&, uint32_t &) { +std::shared_ptr Mailbox::queryDestination(int32_t &, const std::shared_ptr &, std::shared_ptr &, uint32_t &) { return getMailbox(); } diff --git a/src/items/cylinder.hpp b/src/items/cylinder.hpp index b4b606a3965..eb01abebeff 100644 --- a/src/items/cylinder.hpp +++ b/src/items/cylinder.hpp @@ -190,7 +190,7 @@ class VirtualCylinder final : public Cylinder { return nullptr; } - virtual void addThing(const std::shared_ptr&) override { } + virtual void addThing(const std::shared_ptr &) override { } virtual void addThing(int32_t, const std::shared_ptr &) override { } virtual void updateThing(const std::shared_ptr &, uint16_t, uint32_t) override { } virtual void replaceThing(uint32_t, const std::shared_ptr &) override { } diff --git a/src/items/items_classification.hpp b/src/items/items_classification.hpp index 12a6e40e3d0..54521fd7675 100644 --- a/src/items/items_classification.hpp +++ b/src/items/items_classification.hpp @@ -33,5 +33,5 @@ class ItemClassification final { } uint8_t id {}; - std::map tiers{}; + std::map tiers {}; }; diff --git a/src/items/weapons/weapons.hpp b/src/items/weapons/weapons.hpp index 5e123a12a7c..bbe15e12a7d 100644 --- a/src/items/weapons/weapons.hpp +++ b/src/items/weapons/weapons.hpp @@ -339,7 +339,7 @@ class WeaponWand : public Weapon { void configureWeapon(const ItemType &it) override; int32_t getWeaponDamage(const std::shared_ptr &player, const std::shared_ptr &target, const std::shared_ptr &item, bool maxDamage = false) const override; - int32_t getElementDamage(const std::shared_ptr &, const std::shared_ptr&, const std::shared_ptr&) const override { + int32_t getElementDamage(const std::shared_ptr &, const std::shared_ptr &, const std::shared_ptr &) const override { return 0; } CombatType_t getElementType() const override { diff --git a/src/lua/creature/events.cpp b/src/lua/creature/events.cpp index 4aa4d7fbfda..f8c743c628a 100644 --- a/src/lua/creature/events.cpp +++ b/src/lua/creature/events.cpp @@ -637,7 +637,7 @@ void Events::eventPlayerOnLookInBattleList(const std::shared_ptr &player scriptInterface.callVoidFunction(3); } -void Events::eventPlayerOnLookInTrade(const std::shared_ptr &player, const std::shared_ptr &partner, const std::shared_ptr &item, int32_t lookDistance) { +void Events::eventPlayerOnLookInTrade(const std::shared_ptr &player, const std::shared_ptr &partner, const std::shared_ptr &item, int32_t lookDistance) { // Player:onLookInTrade(partner, item, distance) or Player.onLookInTrade(self, partner, item, distance) if (info.playerOnLookInTrade == -1) { return; diff --git a/src/lua/functions/core/game/global_functions.cpp b/src/lua/functions/core/game/global_functions.cpp index df861531764..e5f428ee49f 100644 --- a/src/lua/functions/core/game/global_functions.cpp +++ b/src/lua/functions/core/game/global_functions.cpp @@ -586,7 +586,7 @@ int GlobalFunctions::luaAddEvent(lua_State* L) { LuaData_t type = getNumber(L, -1); if (type != LuaData_t::Unknown && type <= LuaData_t::Npc) { - indexes.emplace_back( i, type ); + indexes.emplace_back(i, type); } lua_pop(globalState, 2); } diff --git a/src/server/network/message/networkmessage.cpp b/src/server/network/message/networkmessage.cpp index fa57693bcdf..8044cf80364 100644 --- a/src/server/network/message/networkmessage.cpp +++ b/src/server/network/message/networkmessage.cpp @@ -85,11 +85,11 @@ void NetworkMessage::addBytes(const char* bytes, size_t size) { } void NetworkMessage::addPaddingBytes(size_t n) { - #define canAdd(size) ((size + info.position) < NETWORKMESSAGE_MAXSIZE) +#define canAdd(size) ((size + info.position) < NETWORKMESSAGE_MAXSIZE) if (!canAdd(n)) { return; } - #undef canAdd +#undef canAdd memset(buffer + info.position, 0x33, n); info.length += n;