1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-09-28 23:40:34 +02:00

fixed crash if mobs attack and player leave

This commit is contained in:
crabman77 2015-07-16 23:33:45 +02:00
parent 89238d025f
commit efd14421f8

View File

@ -961,6 +961,7 @@ end
local s = self.object:getpos()
local p = self.attack.player:getpos()
if not s or not p then return end
p.y = p.y - .5
s.y = s.y + .5
local dist = ((p.x - s.x) ^ 2 + (p.y - s.y) ^ 2 + (p.z - s.z) ^ 2) ^ 0.5