aboutsummaryrefslogtreecommitdiff
path: root/gamemode/inventorysystem/equipment/sh_equipment.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/inventorysystem/equipment/sh_equipment.lua')
-rw-r--r--gamemode/inventorysystem/equipment/sh_equipment.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/gamemode/inventorysystem/equipment/sh_equipment.lua b/gamemode/inventorysystem/equipment/sh_equipment.lua
index b27dd08..a9b6f83 100644
--- a/gamemode/inventorysystem/equipment/sh_equipment.lua
+++ b/gamemode/inventorysystem/equipment/sh_equipment.lua
@@ -77,17 +77,18 @@ end
inv.Put = function(self,position,item)
self.equiped[position[1]] = item
if item.onEquip then item:onEquip(self.Owner) end
+ item.inv = self
end
inv.Has = function(self,string_or_compare_func)
if type(string_or_compare_func) == "string" then
for k,v in pairs(self.equiped) do
- if v.Name == string_or_compare_func then return k end
+ if v.Name == string_or_compare_func then return {k} end
end
return nil
elseif type(string_or_compare_func) == "function" then
for k,v in pairs(self.equiped) do
- if string_or_compare_func(v.Name) then return k end
+ if string_or_compare_func(v.Name) then return {k} end
end
return nil
end
@@ -99,6 +100,7 @@ inv.Remove = function(self,position)
if not item then return end --Make sure we'r enot dragging an empty space
if item.onUnEquip then item:onUnEquip(self.Owner) end
self.equiped[position[1]] = nil
+ item.inv = nil
end
inv.Get = function(self,position)