From a22cbeddc5f8fb61e87a30aa14ba354de5cf4431 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sat, 18 Feb 2017 21:55:55 -0500 Subject: Updates --- gamemode/inventorysystem/cl_common.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'gamemode/inventorysystem/cl_common.lua') diff --git a/gamemode/inventorysystem/cl_common.lua b/gamemode/inventorysystem/cl_common.lua index 07fc786..15f67b4 100644 --- a/gamemode/inventorysystem/cl_common.lua +++ b/gamemode/inventorysystem/cl_common.lua @@ -24,6 +24,9 @@ function com.generatereceiver() local frominv,toinv = panels[1].info.inv,self.info.inv print("Something was dropped on:",x,y) PrintTable(panels) + print("self is", self) + print("self.info is", self.info) + PrintTable(self.info) print("froment:",froment) print("toent:",toent) print("fromid",fromid) @@ -34,6 +37,20 @@ function com.generatereceiver() PrintTable(self.info.pos) print("frominv",frominv) print("toinv",toinv) + + --Do nothing if we don't actually want to move anything anywhere + local posequal = true + if (froment ~= toent) or (fromid ~= toid) or (frominv ~= toinv) then posequal = false end + if posequal then + for k,v in pairs(frompos) do + if topos[k] ~= v then + posequal = false + break + end + end + end + if posequal then return end + local item = frominv:Get(frompos) print("item was", item) --Fake remove the item, in case the position we want to move it to overlaps with where it is now. -- cgit v1.2.3-70-g09d2