From 83843182094d0d99ef7e81b26739051c2d7ff143 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Mon, 5 Mar 2018 21:10:55 -0500 Subject: Fix a bug in shaped inventory Fixed a bug where loading an item in a shaped inventory would be in the wrong graphical slot if not on the diagonal. Caused errors --- gamemode/inventorysystem/shapedinventory/cl_shaped.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gamemode/inventorysystem/shapedinventory/cl_shaped.lua b/gamemode/inventorysystem/shapedinventory/cl_shaped.lua index d74b629..7c60156 100644 --- a/gamemode/inventorysystem/shapedinventory/cl_shaped.lua +++ b/gamemode/inventorysystem/shapedinventory/cl_shaped.lua @@ -129,9 +129,9 @@ inv.DrawOnDPanel = function(self,panel) --Go through the items, and set the dpanels appropriately. for k,v in pairs(self.tracker) do if type(v) == "table" then - local px = k % self.width - local py = math.ceil(k / self.height) - drawitemat(self,px,py,v) + local column = k % self.width + local row = math.ceil(k / self.height) + drawitemat(self,row,column,v) end end -- cgit v1.2.3-70-g09d2