diff --git a/data/events/scripts/player.lua b/data/events/scripts/player.lua index 701275c66a4..c40bf159473 100644 --- a/data/events/scripts/player.lua +++ b/data/events/scripts/player.lua @@ -1,6 +1,3 @@ -CONTAINER_WEIGHT_CHECK = true -- true = enable / false = disable -CONTAINER_WEIGHT_MAX = 1000000 -- 1000000 = 10k = 10000.00 oz - local storeItemID = { -- registered item ids here are not tradable with players -- these items can be set to moveable at items.xml @@ -244,20 +241,13 @@ function Player:onMoveItem(item, count, fromPosition, toPosition, fromCylinder, return false end - -- No move if item count > 20 items + -- No move if tile item count > 20 items local tile = Tile(toPosition) if tile and tile:getItemCount() > 20 then self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE) return false end - -- No move parcel very heavy - if CONTAINER_WEIGHT_CHECK and ItemType(item:getId()):isContainer() - and item:getWeight() > CONTAINER_WEIGHT_MAX then - self:sendCancelMessage("Your cannot move this item too heavy.") - return false - end - -- Players cannot throw items on teleports if blockTeleportTrashing and toPosition.x ~= CONTAINER_POSITION then local thing = Tile(toPosition):getItemByType(ITEM_TYPE_TELEPORT) diff --git a/data/scripts/eventcallbacks/player/on_rotate_item.lua b/data/scripts/eventcallbacks/player/on_rotate_item.lua index 407402056b8..3692fcdc655 100644 --- a/data/scripts/eventcallbacks/player/on_rotate_item.lua +++ b/data/scripts/eventcallbacks/player/on_rotate_item.lua @@ -1,7 +1,7 @@ local callback = EventCallback() function callback.playerOnRotateItem(player, item, position) - if item:getActionId() == 100 then + if item:getActionId() == IMMOVABLE_ACTION_ID then player:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE) return false end diff --git a/src/items/containers/container.cpp b/src/items/containers/container.cpp index 3258fcd477c..6a15e5689d7 100644 --- a/src/items/containers/container.cpp +++ b/src/items/containers/container.cpp @@ -253,7 +253,7 @@ std::deque Container::getStoreInboxFilteredItems() const { phmap::flat_hash_set Container::getStoreInboxValidCategories() const { phmap::flat_hash_set validCategories; - for (const auto& item : itemlist) { + for (const auto &item : itemlist) { auto attribute = item->getCustomAttribute("unWrapId"); uint16_t unWrapId = attribute ? static_cast(attribute->getInteger()) : 0; if (unWrapId != 0) { diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index 442b0a67cec..0e643cb9c1c 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -4312,7 +4312,7 @@ void ProtocolGame::sendContainer(uint8_t cid, const Container* container, bool h if (category.has_value()) { bool toSendCategory = false; // Check if category exist in the deque - for (const auto& tempCategory : categories) { + for (const auto &tempCategory : categories) { if (tempCategory == category.value()) { toSendCategory = true; g_logger().debug("found category {}", toSendCategory);