aboutsummaryrefslogtreecommitdiff
path: root/gamemode/inventorysystem/shapedinventory/cl_shaped.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2018-03-23 15:20:30 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2018-03-23 15:20:30 -0400
commitd2868db28210b8c4debab2b70dca2833d582fdfd (patch)
tree17ad5beb46e3b1c3c17d520a71a4c1ea12c47f51 /gamemode/inventorysystem/shapedinventory/cl_shaped.lua
parenta7f7bed257dd96b1027c6343cd59eea4eee9fc3b (diff)
downloadartery-d2868db28210b8c4debab2b70dca2833d582fdfd.tar.gz
artery-d2868db28210b8c4debab2b70dca2833d582fdfd.tar.bz2
artery-d2868db28210b8c4debab2b70dca2833d582fdfd.zip
Refactored the inventory system
Inventory system now uses flyweight pattern with metatables.
Diffstat (limited to 'gamemode/inventorysystem/shapedinventory/cl_shaped.lua')
-rw-r--r--gamemode/inventorysystem/shapedinventory/cl_shaped.lua3
1 files changed, 3 insertions, 0 deletions
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 .. ")")