aboutsummaryrefslogtreecommitdiff
path: root/gamemode/inventorysystem/shapedinventory/sh_shaped.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2017-11-11 14:20:00 -0500
committerAlexander Pickering <alexandermpickering@gmail.com>2017-11-11 14:20:00 -0500
commit93568fcb09f3e971c50ca10da9b57eccc754cbe6 (patch)
tree63a353d1436f199e08fe17a527c55e879ec75077 /gamemode/inventorysystem/shapedinventory/sh_shaped.lua
parent2252904b8147419c551ad2653a20627281d0531f (diff)
downloadartery-93568fcb09f3e971c50ca10da9b57eccc754cbe6.tar.gz
artery-93568fcb09f3e971c50ca10da9b57eccc754cbe6.tar.bz2
artery-93568fcb09f3e971c50ca10da9b57eccc754cbe6.zip
Removed most of the debug print statements in the core
Also did some other stuff I guess
Diffstat (limited to 'gamemode/inventorysystem/shapedinventory/sh_shaped.lua')
-rw-r--r--gamemode/inventorysystem/shapedinventory/sh_shaped.lua14
1 files changed, 0 insertions, 14 deletions
diff --git a/gamemode/inventorysystem/shapedinventory/sh_shaped.lua b/gamemode/inventorysystem/shapedinventory/sh_shaped.lua
index e9b2e91..5de6272 100644
--- a/gamemode/inventorysystem/shapedinventory/sh_shaped.lua
+++ b/gamemode/inventorysystem/shapedinventory/sh_shaped.lua
@@ -21,7 +21,6 @@ local function canfitin(self,arow,acol,shape)
for rn,row in ipairs(shape) do
for cn,col in ipairs(row) do
local absrow,abscol = arow + rn - 1, acol + cn - 1
- print("absrow was",absrow,"abscol was",abscol)
local slot = calcposition(self.width,self.height,absrow,abscol)
if col and ((self.tracker[slot] ~= nil) or (absrow > self.width) or (abscol > self.height)) then
return false
@@ -53,7 +52,6 @@ function inv:CanFitIn(tbl,item)
end
function inv:Put(tbl,item)
- print("Calling put")
--Set the item's shape to true
for rn,row in ipairs(item.Shape) do
@@ -66,9 +64,7 @@ function inv:Put(tbl,item)
end
--Now set the item in the correct slot
- print("Put item at ",tbl[1],tbl[2])
local slot = calcposition(self.width,self.height,tbl[1],tbl[2])
- print("Slot is",slot)
self.tracker[slot] = item
end
@@ -81,10 +77,8 @@ function inv:Has(ptr)
end
for k,v in pairs(self.tracker) do
if type(v) == "table" and compare_func(v) then
- print("Found item in spot:",k)
local row = math.ceil(k / self.width)
local col = ((k - 1) % self.width) + 1
- print("Has is retuning",row,col)
return {row,col}
end
end
@@ -93,7 +87,6 @@ end
function inv:Remove(tbl)
local slot = calcposition(self.width,self.height,tbl[1],tbl[2])
- print("Slot is",slot)
local item = self.tracker[slot]
self.tracker[slot] = nil
for rn,row in ipairs(item.Shape) do
@@ -104,7 +97,6 @@ function inv:Remove(tbl)
end
end
end
- print("shaped is returning",item)
return item
end
@@ -127,19 +119,13 @@ function inv:Serialize()
end
function inv:DeSerialize(str)
- print("Deserialize str is", str)
local ret = table.Copy(self)
local tbl = util.JSONToTable(str)
- print("unjsoned is",tbl,type(tbl))
- PrintTable(tbl)
for k,v in pairs(tbl) do
local name = k
local pos = v[1]
local data = v[2]
local item = itm.GetItemFromData(name,data)
- print("Got item",item)
- PrintTable(item)
- print("got pos",pos)
ret:Put(pos,item)
--ret.tracker[pos] = itm.GetItemFromData(name,data)
end