From 2c4329e2b6e19182a441f79a5c3010011f8ae767 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sun, 27 Nov 2016 22:02:47 -0500 Subject: Vairous updates --- gamemode/shared/loadnpcs.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gamemode/shared/loadnpcs.lua') diff --git a/gamemode/shared/loadnpcs.lua b/gamemode/shared/loadnpcs.lua index bff5135..3e1861f 100644 --- a/gamemode/shared/loadnpcs.lua +++ b/gamemode/shared/loadnpcs.lua @@ -4,11 +4,13 @@ local f = include("concommands.lua") ART = ART or {} local npcs = {} +local autocompletef function ART.RegisterNPC(npc) assert(npc ~= nil, "Attempted to register a nil npc") assert(npc.Name ~= nil, "Attempted to register an npc without a name") npcs[npc.Name] = npc + autocompletef = f.AutocompleteFunction(npcs) end function ART.CreateNPCByName(npcname, pos) @@ -20,9 +22,10 @@ function ART.CreateNPCByName(npcname, pos) npc[k] = v end npc:Spawn() + return npc end -local autocompletef + if SERVER then autocompletef = nil else -- cgit v1.2.3-70-g09d2