aboutsummaryrefslogtreecommitdiff
path: root/gamemode/npcsystem/aidirector.lua
diff options
context:
space:
mode:
authorAlexander Pickering <Alexander.Pickering@anondomain.site90.net>2015-12-30 20:06:08 -0500
committerAlexander Pickering <Alexander.Pickering@anondomain.site90.net>2015-12-30 20:06:08 -0500
commit84279bbb034aef483276926255e88c531219aa31 (patch)
treed2c2b5e9c1152dfa515406e6912b42c1f369faf0 /gamemode/npcsystem/aidirector.lua
parent70974924b1dc9e116221736ff30629f18b5f893b (diff)
downloadwintersurvival2-84279bbb034aef483276926255e88c531219aa31.tar.gz
wintersurvival2-84279bbb034aef483276926255e88c531219aa31.tar.bz2
wintersurvival2-84279bbb034aef483276926255e88c531219aa31.zip
Fixed birds crashing if not spawned on a valid navmesh
Diffstat (limited to 'gamemode/npcsystem/aidirector.lua')
-rw-r--r--gamemode/npcsystem/aidirector.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/gamemode/npcsystem/aidirector.lua b/gamemode/npcsystem/aidirector.lua
index d671b3c..b0a76a9 100644
--- a/gamemode/npcsystem/aidirector.lua
+++ b/gamemode/npcsystem/aidirector.lua
@@ -1,16 +1,18 @@
--Lol i dunno, spawn some npc's or something
concommand.Add("ws_spawnzomb",function(ply, cmd, args)
- SpawnNpcByName("Zombie",ply:GetPos())
- end
-)
+ SpawnNpcByName("Zombie",ply:GetPos())
+end)
+
+concommand.Add("ws_spawnbird",function(ply,cmd,args)
+ SpawnNpcByName("Bird",ply:GetPos())
+end)
function SpawnNpcByName(name, position)
entdata = GetNpcByName(name)
ent = ents.Create("ws_npc_ambient")
ent:SetPos(position)
-
if(entdata.Speed) then
ent.Speed = entdata.Speed
end
@@ -72,7 +74,6 @@ hook.Add("Tick","SpawnAmbient",function()
if (C != CONTENTS_WATER and C != CONTENTS_WATER+CONTENTS_TRANSLUCENT) then
--print("Appropriate place found, spawning bird)")
- --SpawnNpcByName("Bird",Pos)
break
end
end