aboutsummaryrefslogtreecommitdiff
path: root/gamemode/inventorysystem/equipment
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2017-08-19 23:49:16 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2017-08-19 23:49:16 -0400
commit978909d830dd173f8b018f36c5f142d225732ba1 (patch)
tree70da6bb1c049ff5884eb7cf7ec6dc55ead8aaa96 /gamemode/inventorysystem/equipment
parentbfc245bc694f6e3eb79b8a6df1776a6f61dc2c64 (diff)
downloadartery-978909d830dd173f8b018f36c5f142d225732ba1.tar.gz
artery-978909d830dd173f8b018f36c5f142d225732ba1.tar.bz2
artery-978909d830dd173f8b018f36c5f142d225732ba1.zip
Fixed a bug with equipment inventories
Diffstat (limited to 'gamemode/inventorysystem/equipment')
-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 0cd62e9..8dc9442 100644
--- a/gamemode/inventorysystem/equipment/sh_equipment.lua
+++ b/gamemode/inventorysystem/equipment/sh_equipment.lua
@@ -108,7 +108,9 @@ end
inv.Serialize = function(self)
local tbl = {}
for k,v in pairs(self.equiped) do
- tbl[k] = v:Serialize()
+ if v then
+ tbl[k] = {v.Name, v:Serialize()}
+ end
end
return util.TableToJSON(tbl)
end
@@ -118,7 +120,7 @@ inv.DeSerialize = function(self,data)
local tbl = util.JSONToTable(data)
local cpy = table.Copy(self)
for k,v in pairs(tbl) do
- cpy.equiped[k] = itm.GetItemFromData(v)
+ cpy.equiped[k] = itm.GetItemByName(v[1]):DeSerialize(v[2])
end
return cpy
else