aboutsummaryrefslogtreecommitdiff
path: root/gamemode/npcsystem/aidirector.lua
diff options
context:
space:
mode:
authorAlexander Pickering <Alexander.Pickering@anondomain.site90.net>2016-01-02 22:24:46 -0500
committerAlexander Pickering <Alexander.Pickering@anondomain.site90.net>2016-01-02 22:24:46 -0500
commitb94ae1f187c46f1f775575daadc893a35890b6c3 (patch)
treee2701501e160ce23e96da9260fc80468e50d1630 /gamemode/npcsystem/aidirector.lua
parenta7a1e3a2d23e4aa10d874ad1b663d2116c1f62cb (diff)
downloadwintersurvival2-b94ae1f187c46f1f775575daadc893a35890b6c3.tar.gz
wintersurvival2-b94ae1f187c46f1f775575daadc893a35890b6c3.tar.bz2
wintersurvival2-b94ae1f187c46f1f775575daadc893a35890b6c3.zip
Introduced npc-determined spawn position
Diffstat (limited to 'gamemode/npcsystem/aidirector.lua')
-rw-r--r--gamemode/npcsystem/aidirector.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/gamemode/npcsystem/aidirector.lua b/gamemode/npcsystem/aidirector.lua
index f5cf2b4..a78e41e 100644
--- a/gamemode/npcsystem/aidirector.lua
+++ b/gamemode/npcsystem/aidirector.lua
@@ -94,8 +94,9 @@ hook.Add("Tick","SpawnAmbient",function()
--print("Appropriate place found, spawning bird)")
local randnpcnum = math.Round(math.Rand(0, #ambientnpcs))
local npc = GetNpcByName(ambientnpcs[randnpcnum])
- if(npc:)
- SpawnNpcByName(ambientnpcs[randnpcnum],Pos)
+ if(npc:SpawnLocations(Pos)) then
+ SpawnNpcByName(ambientnpcs[randnpcnum],Pos)
+ end
break
end
end