Implemented json encoded inventory, closes #177

This commit is contained in:
ElPumpo
2020-02-12 12:33:14 +01:00
parent b2a46fdfb3
commit f236a67d63
3 changed files with 58 additions and 94 deletions
+14 -2
View File
@@ -129,8 +129,20 @@ function CreateExtendedPlayer(player, accounts, inventory, job, loadout, name, c
end
end
self.getInventory = function()
return self.inventory
self.getInventory = function(minimal)
if minimal then
local items = {}
for k,v in ipairs(self.inventory) do
if v.count > 0 then
items[v.name] = v.count
end
end
return items
else
return self.inventory
end
end
self.getJob = function()