diff options
Diffstat (limited to 'gamemode/shared/loadnpcs.lua')
| -rw-r--r-- | gamemode/shared/loadnpcs.lua | 5 |
1 files changed, 4 insertions, 1 deletions
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 |
