mirror of
https://github.com/Poikilos/mobs.git
synced 2023-10-03 07:28:50 -07:00
Removed unneccessary code so monsters will always pursue if they see you.
This commit is contained in:
parent
c49cc4726c
commit
299d363402
14
api.lua
14
api.lua
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user