From 8db86ee45c1e876914a54d2d690733cbd53a851a Mon Sep 17 00:00:00 2001 From: Gabriel Tofvesson Date: Sat, 30 Nov 2024 00:20:21 +0100 Subject: [PATCH] Remove debug statements --- storage/itemstack.lua | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/storage/itemstack.lua b/storage/itemstack.lua index a1a29b7..b5539de 100644 --- a/storage/itemstack.lua +++ b/storage/itemstack.lua @@ -2,23 +2,10 @@ local Inventory = require("storage.inventory") local Sentinel = require("storage.sentinel") local Logging = require("logging") local Logger = Logging.getGlobalLogger() -local Debugger = require("debugger") local ItemStack = Sentinel:tag({}, Sentinel.ITEMSTACK) ItemStack.__index = ItemStack -local function hookDebugger(context) - local result, retval - repeat - result, retval = Debugger.debugREPL(function(r) - Logger:error("->", r) - end, context) - if not result then - Logger:error("x>", retval) - end - until result -end - function ItemStack:fromDetail(inv, detail, slot) local obj = { slot = slot, @@ -204,10 +191,6 @@ function ItemStack:_modify(countDelta, stack) end function ItemStack:transferTo(target, count) - if target:getMaxCount() == nil then - Logger:error("Max count is nil?", target, "\n", self, "\n", count) - hookDebugger({ target = target, count = count, self = self }) - end local cap = math.min(count or self:getCount(), target:getMaxCount() - target:getCount(), self:getCount()) -- If we can't transfer any data, then @@ -226,20 +209,6 @@ function ItemStack:transferTo(target, count) return false, result[2] end - if result[2] == nil then - Logger:error( - "Error transferring item", self:getInventory().pushItems, "\n", - peripheral.getName(target:getInventory()), "\n", - errC, "\n", - cap, "\n", - self, "\n", - target, "\n", - target:getInventory().getItemLimit(target:getSlot()), "\n", - result - ) - hookDebugger({ target = target, count = count, self = self, result = result, errC = errC, cap = cap }) - end - target:_modify(result[2], self) self:_modify(-result[2], self)