Removed unneccessary code so monsters will always pursue if they see you.

This commit is contained in:
ElectricSolstice 2013-10-13 17:27:45 -07:00
parent c49cc4726c
commit 299d363402

14
api.lua
View File

@ -221,17 +221,9 @@ function mobs:register_mob(name, def)
local p = player:getpos() local p = player:getpos()
local dist = ((p.x-s.x)^2 + (p.y-s.y)^2 + (p.z-s.z)^2)^0.5 local dist = ((p.x-s.x)^2 + (p.y-s.y)^2 + (p.z-s.z)^2)^0.5
if dist < self.view_range then if dist < self.view_range then
if self.attack.dist then self.state = "attack"
if self.attack.dist < dist then self.attack.player = player
self.state = "attack" self.attack.dist = dist
self.attack.player = player
self.attack.dist = dist
end
else
self.state = "attack"
self.attack.player = player
self.attack.dist = dist
end
end end
end end
end end