diff options
Diffstat (limited to 'gamemode/inventorysystem/prayers/sh_prayers.lua')
| -rw-r--r-- | gamemode/inventorysystem/prayers/sh_prayers.lua | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gamemode/inventorysystem/prayers/sh_prayers.lua b/gamemode/inventorysystem/prayers/sh_prayers.lua index 83414b7..15cd2af 100644 --- a/gamemode/inventorysystem/prayers/sh_prayers.lua +++ b/gamemode/inventorysystem/prayers/sh_prayers.lua @@ -1,7 +1,16 @@ +--[[ + prayers must have a "Pray" method, + a "Name" string, + a "Description" string +]] local reg = nrequire("inventory/inventory.lua") local itm = nrequire("item.lua") local inv = {} +if CLIENT then + inv = nrequire("cl_prayers.lua") +end + inv.Name = "Prayers" inv.track = {} function inv:FindPlaceFor(item) @@ -42,12 +51,14 @@ function inv:Serialize() end function inv:DeSerialize(str) + local cpy = table.Copy(self) local tbl = util.JSONToTable(str) local i = 1 for k,v in pairs(tbl) do local this_prayer = itm.GetItemByName(k):DeSerialize(v) - self:Put({i},this_prayer) + cpy:Put({i},this_prayer) end + return cpy end |
