aboutsummaryrefslogtreecommitdiff
path: root/gamemode/npcsystem
diff options
context:
space:
mode:
authorAlexander Pickering <Alexander.Pickering@anondomain.site90.net>2015-12-30 22:18:49 -0500
committerAlexander Pickering <Alexander.Pickering@anondomain.site90.net>2015-12-30 22:18:49 -0500
commit5ed16717129121ebb9c7c1012d1ce17f2aa71bf7 (patch)
treec5621bc31838d842f1e45340b6cf5d68d051af20 /gamemode/npcsystem
parentad728d580ea64797f7bcd02894f18cc4d1072d97 (diff)
downloadwintersurvival2-5ed16717129121ebb9c7c1012d1ce17f2aa71bf7.tar.gz
wintersurvival2-5ed16717129121ebb9c7c1012d1ce17f2aa71bf7.tar.bz2
wintersurvival2-5ed16717129121ebb9c7c1012d1ce17f2aa71bf7.zip
Fixed birds crashing with no nav meshes
Diffstat (limited to 'gamemode/npcsystem')
-rw-r--r--gamemode/npcsystem/npcs/bird.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/gamemode/npcsystem/npcs/bird.lua b/gamemode/npcsystem/npcs/bird.lua
index 0393532..fa3ad8d 100644
--- a/gamemode/npcsystem/npcs/bird.lua
+++ b/gamemode/npcsystem/npcs/bird.lua
@@ -58,7 +58,7 @@ function NPC:Behave()
--Keep flying away as long as we're being chased
while((dist < fardist and not iscrouched) or (dist < closedist)) do
self:StartActivity(ACT_FLY)
- self:SetSequence( "Fly01" )
+ self:PlaySequenceAndWait( "Fly01" )
--Find a position in roughly the oposite direction of the player
local tpos = self:GetPos()
@@ -76,12 +76,16 @@ function NPC:Behave()
end
--]]
local navarea = navmesh.GetNavArea(self:GetPos(), 100)
+
if navarea:IsValid() then
+ --print("Looks like nav area is valid")
self:MoveToPos(topos)
else
+ --print("Looks like nav area is invalid")
self:BecomeRagdoll(DamageInfo())
end
- --
+
+
--Check to see if we're being chased
iscrouched = v:Crouching()