From 9ba957b99603590b099f4bcd22a9cc86525dbcde Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sat, 2 Sep 2017 17:34:27 -0400 Subject: Various debugging things --- gamemode/client/qtabs/cl_qinventory.lua | 1 + gamemode/core/inventory/item.lua | 1 + gamemode/inventorysystem/shapedinventory/cl_shaped.lua | 2 ++ 3 files changed, 4 insertions(+) (limited to 'gamemode') diff --git a/gamemode/client/qtabs/cl_qinventory.lua b/gamemode/client/qtabs/cl_qinventory.lua index 9f2eebe..1e1ceb3 100644 --- a/gamemode/client/qtabs/cl_qinventory.lua +++ b/gamemode/client/qtabs/cl_qinventory.lua @@ -60,6 +60,7 @@ local drawsheeton = function(id,inventory) end net.Receive("art_ObserveInventory",function() + print("Got call to observe inventory") local id = net.ReadUInt(32) local inv_type = net.ReadString() --print("Got inv type", inv_type,"id",id) diff --git a/gamemode/core/inventory/item.lua b/gamemode/core/inventory/item.lua index a13efa9..a598fc2 100644 --- a/gamemode/core/inventory/item.lua +++ b/gamemode/core/inventory/item.lua @@ -39,6 +39,7 @@ function itm.RegisterItem(tbl) end function itm.GetItemByName(name) + assert(type(name) == "string",string.format("Attempted to get an item by name with a %s.")) assert(items[name] ~= nil,string.format("Attempted to get item with invalid name %q Valid item names are:\n\t%s",name,table.concat(table.GetKeys(items),"\n\t"))) local item if items[name].init then diff --git a/gamemode/inventorysystem/shapedinventory/cl_shaped.lua b/gamemode/inventorysystem/shapedinventory/cl_shaped.lua index 746a37a..dde523f 100644 --- a/gamemode/inventorysystem/shapedinventory/cl_shaped.lua +++ b/gamemode/inventorysystem/shapedinventory/cl_shaped.lua @@ -139,9 +139,11 @@ 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 -- cgit v1.2.3-70-g09d2