Skip to content

Commit

Permalink
Lua code format - (Stylua)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Feb 12, 2025
1 parent 4de411a commit e611679
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions data/libs/functions/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -858,26 +858,26 @@ end

function Player.checkAndSendDepotMessage(self)
for _, direction in ipairs(DIRECTIONS_TABLE) do
local playerPosition = self:getPosition()
playerPosition:getNextPosition(direction)

local tile = playerPosition:getTile()
if tile then
local depotItem = tile:getItemByType(ITEM_TYPE_DEPOT)
if depotItem then
local depotItems = 0
for id = 1, configManager.getNumber(configKeys.DEPOT_BOXES) do
depotItems = depotItems + self:getDepotChest(id, true):getItemHoldingCount()
end

local depotMessage = string.format("Your depot contains %d item%s", depotItems, depotItems ~= 1 and "s." or ".")
local stashMessage = string.format("Your supply stash contains %d item%s", self:getStashCount(), self:getStashCount() ~= 1 and "s." or ".")

self:sendTextMessage(MESSAGE_STATUS, string.format("%s %s", depotMessage, stashMessage))
self:setSpecialContainersAvailable(true, true, true)
return true
end
local playerPosition = self:getPosition()
playerPosition:getNextPosition(direction)

local tile = playerPosition:getTile()
if tile then
local depotItem = tile:getItemByType(ITEM_TYPE_DEPOT)
if depotItem then
local depotItems = 0
for id = 1, configManager.getNumber(configKeys.DEPOT_BOXES) do
depotItems = depotItems + self:getDepotChest(id, true):getItemHoldingCount()
end

local depotMessage = string.format("Your depot contains %d item%s", depotItems, depotItems ~= 1 and "s." or ".")
local stashMessage = string.format("Your supply stash contains %d item%s", self:getStashCount(), self:getStashCount() ~= 1 and "s." or ".")

self:sendTextMessage(MESSAGE_STATUS, string.format("%s %s", depotMessage, stashMessage))
self:setSpecialContainersAvailable(true, true, true)
return true
end
end
end
return true
end

0 comments on commit e611679

Please sign in to comment.