From 93568fcb09f3e971c50ca10da9b57eccc754cbe6 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sat, 11 Nov 2017 14:20:00 -0500 Subject: Removed most of the debug print statements in the core Also did some other stuff I guess --- gamemode/inventorysystem/shapedinventory/cl_shaped.lua | 4 ---- gamemode/inventorysystem/shapedinventory/sh_shaped.lua | 14 -------------- 2 files changed, 18 deletions(-) (limited to 'gamemode/inventorysystem/shapedinventory') diff --git a/gamemode/inventorysystem/shapedinventory/cl_shaped.lua b/gamemode/inventorysystem/shapedinventory/cl_shaped.lua index dde523f..d74b629 100644 --- a/gamemode/inventorysystem/shapedinventory/cl_shaped.lua +++ b/gamemode/inventorysystem/shapedinventory/cl_shaped.lua @@ -46,7 +46,6 @@ end --Draw the item in a position local function drawitemat(self,x,y,item) - print("Drawing item at ",x,y) local tp = self.gridpanels[x][y] if tp == nil then error("Unable to continue, could not find item at (" .. x .. "," .. y .. ")") @@ -67,7 +66,6 @@ local function drawitemat(self,x,y,item) end end if item.DoOnPanel then - print("Calling cl_shaped's DoOnPanel") item:DoOnPanel(tp) end if item.Paint then @@ -139,11 +137,9 @@ inv.DrawOnDPanel = function(self,panel) local observer = {} observer.Put = function(obs,position,item) - print("observer's put was called") drawitemat(self,position[1],position[2],item) end observer.Remove = function(obs,position) - print("observer's remove was called") undrawitemat(self,position[1],position[2]) end return observer 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 -- cgit v1.2.3-70-g09d2