summaryrefslogtreecommitdiff
path: root/gamemode/itemsystem/loaditems.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-05-06 20:20:56 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2016-05-06 20:20:56 -0400
commit5322c9c6534054c0e2da6441e477d0b2166fbe97 (patch)
treec10bba96ddcbb82b000f5cc569cdfff5e5522d08 /gamemode/itemsystem/loaditems.lua
parent76e9c919b926f35f51e147e042eadc992f06018e (diff)
downloadgmstranded-5322c9c6534054c0e2da6441e477d0b2166fbe97.tar.gz
gmstranded-5322c9c6534054c0e2da6441e477d0b2166fbe97.tar.bz2
gmstranded-5322c9c6534054c0e2da6441e477d0b2166fbe97.zip
Did some refactoring
Diffstat (limited to 'gamemode/itemsystem/loaditems.lua')
-rw-r--r--gamemode/itemsystem/loaditems.lua20
1 files changed, 4 insertions, 16 deletions
diff --git a/gamemode/itemsystem/loaditems.lua b/gamemode/itemsystem/loaditems.lua
index a77ffb3..225e56d 100644
--- a/gamemode/itemsystem/loaditems.lua
+++ b/gamemode/itemsystem/loaditems.lua
@@ -5,29 +5,17 @@
GMS.Resources = {}
function GMS.RegisterResource( tbl )
- if(tbl == nil) then
- print("/gamemode/itemsystem/loaditems.lua: Attempted to register a nil entity! This might be a bug!")
- return
- end
- if(tbl.Name == nil) then
- print("/gamemode/itemsystem/loaditems.lua: Attempted to register an item with no name:")
- PrintTable(tbl)
- print("This might be a bug!")
- return
- end
+ assert(tbl != nil,"Attempted to register a nil entity! This might be a bug!")
+ assert(tbl.Name != nil,"Attempted to register an item with no name:")
if(tbl.UniqueData) then
tbl.UniqueDataID = -1
end
- print("Registering item:" .. tbl.Name)
GMS.Resources[tbl.Name] = tbl
end
function GMS.GetResourceByName(name)
- if(GMS.Resources[name]) then
- return GMS.Resources[name]
- else
- print("Resource " .. name .. " does not exist! This might be a bug!")
- end
+ assert(GMS.Resources[name] != nil, "Resource " .. name .. " does not exist! This might be a bug!")
+ return GMS.Resources[name]
end
concommand.Add("gms_printrestable",function(ply,cmd,args)