From d2868db28210b8c4debab2b70dca2833d582fdfd Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Fri, 23 Mar 2018 15:20:30 -0400 Subject: Refactored the inventory system Inventory system now uses flyweight pattern with metatables. --- gamemode/inventorysystem/shapedinventory/cl_shaped.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gamemode/inventorysystem/shapedinventory/cl_shaped.lua') diff --git a/gamemode/inventorysystem/shapedinventory/cl_shaped.lua b/gamemode/inventorysystem/shapedinventory/cl_shaped.lua index 7c60156..d9a4a08 100644 --- a/gamemode/inventorysystem/shapedinventory/cl_shaped.lua +++ b/gamemode/inventorysystem/shapedinventory/cl_shaped.lua @@ -46,6 +46,9 @@ end --Draw the item in a position local function drawitemat(self,x,y,item) + assert(self ~= nil, "I am nil!") + assert(self.gridpanels ~= nil, "My gridpanels were nil!") + assert(self.gridpanels[x] ~= nil, "Could not find that row!") local tp = self.gridpanels[x][y] if tp == nil then error("Unable to continue, could not find item at (" .. x .. "," .. y .. ")") -- cgit v1.2.3-70-g09d2