aboutsummaryrefslogtreecommitdiff
path: root/gamemode/inventorysystem/cl_common.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2017-02-18 21:55:55 -0500
committerAlexander Pickering <alexandermpickering@gmail.com>2017-02-18 21:55:55 -0500
commita22cbeddc5f8fb61e87a30aa14ba354de5cf4431 (patch)
tree297c1dbfb23185c5246e1dd7bdec52253a24ba60 /gamemode/inventorysystem/cl_common.lua
parentf4ee62bb0725a3ae94477b2818071f506e4dfd9f (diff)
downloadartery-a22cbeddc5f8fb61e87a30aa14ba354de5cf4431.tar.gz
artery-a22cbeddc5f8fb61e87a30aa14ba354de5cf4431.tar.bz2
artery-a22cbeddc5f8fb61e87a30aa14ba354de5cf4431.zip
Updates
Diffstat (limited to 'gamemode/inventorysystem/cl_common.lua')
-rw-r--r--gamemode/inventorysystem/cl_common.lua17
1 files changed, 17 insertions, 0 deletions
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.