Implement debug context args
This commit is contained in:
parent
e98014d29b
commit
3f372d4674
@ -7,10 +7,10 @@ local Debugger = require("debugger")
|
|||||||
local ItemStack = Sentinel:tag({}, Sentinel.ITEMSTACK)
|
local ItemStack = Sentinel:tag({}, Sentinel.ITEMSTACK)
|
||||||
ItemStack.__index = ItemStack
|
ItemStack.__index = ItemStack
|
||||||
|
|
||||||
local function hookDebugger()
|
local function hookDebugger(context)
|
||||||
local errorCond = Debugger.debugREPL(function(retval)
|
local errorCond = Debugger.debugREPL(function(retval)
|
||||||
Logger:error("->", retval)
|
Logger:error("->", retval)
|
||||||
end)
|
end, context)
|
||||||
Logger:error("x>", errorCond)
|
Logger:error("x>", errorCond)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -202,7 +202,7 @@ end
|
|||||||
function ItemStack:transferTo(target, count)
|
function ItemStack:transferTo(target, count)
|
||||||
if target:getMaxCount() == nil then
|
if target:getMaxCount() == nil then
|
||||||
Logger:error("Max count is nil?", target, "\n", self, "\n", count)
|
Logger:error("Max count is nil?", target, "\n", self, "\n", count)
|
||||||
hookDebugger()
|
hookDebugger({ target = target, count = count, self = self })
|
||||||
end
|
end
|
||||||
local cap = math.min(count or self:getCount(), target:getMaxCount() - target:getCount(), self:getCount())
|
local cap = math.min(count or self:getCount(), target:getMaxCount() - target:getCount(), self:getCount())
|
||||||
|
|
||||||
@ -233,7 +233,7 @@ function ItemStack:transferTo(target, count)
|
|||||||
target:getInventory().getItemLimit(target:getSlot()), "\n",
|
target:getInventory().getItemLimit(target:getSlot()), "\n",
|
||||||
result
|
result
|
||||||
)
|
)
|
||||||
hookDebugger()
|
hookDebugger({ target = target, count = count, self = self, result = result, errC = errC, cap = cap })
|
||||||
end
|
end
|
||||||
|
|
||||||
target:_modify(result[2], self)
|
target:_modify(result[2], self)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user