aboutsummaryrefslogtreecommitdiff
path: root/gamemode/shared/loaditems.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2017-08-24 20:32:34 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2017-08-24 20:32:34 -0400
commit233e478e40d72a091f70f18dc6846066a4f52016 (patch)
treecf34be714088889731736c81bd44e198c792625a /gamemode/shared/loaditems.lua
parent61bc16dae5a1b61bcd237d9f0be36125829d95b1 (diff)
downloadartery-233e478e40d72a091f70f18dc6846066a4f52016.tar.gz
artery-233e478e40d72a091f70f18dc6846066a4f52016.tar.bz2
artery-233e478e40d72a091f70f18dc6846066a4f52016.zip
Fix all linter warnings
Diffstat (limited to 'gamemode/shared/loaditems.lua')
-rw-r--r--gamemode/shared/loaditems.lua122
1 files changed, 61 insertions, 61 deletions
diff --git a/gamemode/shared/loaditems.lua b/gamemode/shared/loaditems.lua
index 9975bb3..dba80e8 100644
--- a/gamemode/shared/loaditems.lua
+++ b/gamemode/shared/loaditems.lua
@@ -1,61 +1,61 @@
-do return end
---[=[
---[[
- This file loads in all the items
-]]
-local concmd = include("concommands.lua")
---local autolua = include("../autolua.lua")
-print("Hello from LoadItems.lua!")
-ART.Items = {}
-local requiredfields = {
- "Name",
- "Shape",
- "Serialize",
- "DeSerialize",
-}
-local defaultfields = {
- ["Serialize"] = function(self) return "" end,
- ["DeSerialize"] = function(self,string) return self end,
- ["Shape"] = {{true}},
-}
-function ART.RegisterItem(tbl)
- --print("Registering item:" .. tbl.Name)
- for k,v in pairs(requiredfields) do
- assert(tbl[v] ~= nil, "Attempted to register an item without field:" .. v)
- end
- assert(ART.Items[tbl.Name] == nil, "Attempted to register 2 items with the same name!")
- for k,v in pairs(defaultfields) do
- if tbl[k] == nil then
- tbl[k] = v
- end
- end
- ART.Items[tbl.Name] = tbl
- --print("Art is now:")
- --PrintTable(ART)
-end
-
---autolua.AddLuaSHFolder("/shared/itemsystem")
-
-function ART.GiveItem(player,name)
- assert(ART.Items[name] ~= nil, "Attempted to give a nil item!")
- player:GiveItem(ART.Items[name])
- player:SynchronizeInventory()
-end
-
-function ART.GetItemByName(name)
- assert(ART.Items[name] ~= nil,"Attempted to get a nil item:" .. name)
- return ART.Items[name]
-end
-
-concommand.Add("artery_printitems",function(ply,cmd,args)
- if not ply:IsAdmin() then return end
- print("Items table:")
- PrintTable(ART.Items)
-end)
-
-concommand.Add("artery_giveitem",function(ply,cmd,args)
- if not ply:IsAdmin() then return end
- print("Trying to give an item:" .. args[1])
- ART.GiveItem(ply,args[1])
-end, concmd.AutocompleteFunction(table.GetKeys(ART.Items)), "Give an item to the specified player, or yourself if no player is specified.")
-]=]
+-- do return end
+-- --[=[
+-- --[[
+-- This file loads in all the items
+-- ]]
+-- local concmd = include("concommands.lua")
+-- --local autolua = include("../autolua.lua")
+-- print("Hello from LoadItems.lua!")
+-- ART.Items = {}
+-- local requiredfields = {
+-- "Name",
+-- "Shape",
+-- "Serialize",
+-- "DeSerialize",
+-- }
+-- local defaultfields = {
+-- ["Serialize"] = function(self) return "" end,
+-- ["DeSerialize"] = function(self,string) return self end,
+-- ["Shape"] = {{true}},
+-- }
+-- function ART.RegisterItem(tbl)
+-- --print("Registering item:" .. tbl.Name)
+-- for k,v in pairs(requiredfields) do
+-- assert(tbl[v] ~= nil, "Attempted to register an item without field:" .. v)
+-- end
+-- assert(ART.Items[tbl.Name] == nil, "Attempted to register 2 items with the same name!")
+-- for k,v in pairs(defaultfields) do
+-- if tbl[k] == nil then
+-- tbl[k] = v
+-- end
+-- end
+-- ART.Items[tbl.Name] = tbl
+-- --print("Art is now:")
+-- --PrintTable(ART)
+-- end
+--
+-- --autolua.AddLuaSHFolder("/shared/itemsystem")
+--
+-- function ART.GiveItem(player,name)
+-- assert(ART.Items[name] ~= nil, "Attempted to give a nil item!")
+-- player:GiveItem(ART.Items[name])
+-- player:SynchronizeInventory()
+-- end
+--
+-- function ART.GetItemByName(name)
+-- assert(ART.Items[name] ~= nil,"Attempted to get a nil item:" .. name)
+-- return ART.Items[name]
+-- end
+--
+-- concommand.Add("artery_printitems",function(ply,cmd,args)
+-- if not ply:IsAdmin() then return end
+-- print("Items table:")
+-- PrintTable(ART.Items)
+-- end)
+--
+-- concommand.Add("artery_giveitem",function(ply,cmd,args)
+-- if not ply:IsAdmin() then return end
+-- print("Trying to give an item:" .. args[1])
+-- ART.GiveItem(ply,args[1])
+-- end, concmd.AutocompleteFunction(table.GetKeys(ART.Items)), "Give an item to the specified player, or yourself if no player is specified.")
+-- ]=]