aboutsummaryrefslogtreecommitdiff
path: root/gamemode/inventorysystem
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2017-11-27 15:38:51 -0500
committerAlexander Pickering <alexandermpickering@gmail.com>2017-11-27 15:38:51 -0500
commit6d46bb53c056bc42856ff8a0365843ef108ee9a5 (patch)
tree0533ed22646d123d9775c6f0fa8e69a54b8da81e /gamemode/inventorysystem
parentbe226eaf4042cadd5ad849f4c8b84243c83f2bbd (diff)
downloadartery-6d46bb53c056bc42856ff8a0365843ef108ee9a5.tar.gz
artery-6d46bb53c056bc42856ff8a0365843ef108ee9a5.tar.bz2
artery-6d46bb53c056bc42856ff8a0365843ef108ee9a5.zip
Fix to example inventory
Diffstat (limited to 'gamemode/inventorysystem')
-rw-r--r--gamemode/inventorysystem/exampleinventory.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/gamemode/inventorysystem/exampleinventory.lua b/gamemode/inventorysystem/exampleinventory.lua
index b8c539f..1e4af47 100644
--- a/gamemode/inventorysystem/exampleinventory.lua
+++ b/gamemode/inventorysystem/exampleinventory.lua
@@ -3,6 +3,7 @@
--@classmod invtbl
local inv = {}
+local reg = nrequire("inventory.lua")
---Inventory name.
-- All inventories must have a name, names must be unique per TYPE of inventory.
@@ -85,7 +86,7 @@ end
-- Returns a string that the inventory can be rebuilt from. This should include all items currently in the inventory. Take advantage of the fact that items must also have a Serailize() method.
--@tparam invtbl self The instance of the inventory to serialize
--@treturn string The string representation of this inventory
-function inv.Serailize(self)
+function inv.Serialize(self)
local items = {}
for k,v in pairs(self.items) do
items[k] = {v.Name,v:Serialize()}
@@ -108,4 +109,4 @@ function inv.DeSerialize(self,str)
return cpy
end
-RegisterInventory(inv)
+reg.RegisterInventory(inv)