Add files via upload

master
AiTechEye 2021-02-05 21:22:21 +01:00 committed by GitHub
parent 70f71a065b
commit 5962ac0168
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1547,7 +1547,7 @@ aliveai.pointat=function(self,d)
end
aliveai.distance=function(pos1,pos2)
if not (pos1 and pos2) then
if not (pos1 and pos1.x and pos2 and pos2.x) then
return 0
end
pos1 = type(pos1) == "userdata" and pos1:get_pos() or pos1.object and pos1.object:get_pos() or pos1
@ -1562,7 +1562,7 @@ aliveai.visiable=function(pos1,pos2)
pos1 = type(pos1) == "userdata" and pos1:get_pos() or pos1.object and pos1.object:get_pos() or pos1
pos2 = type(pos2) == "userdata" and pos2:get_pos() or pos2
if not (pos1 and pos2) then
if not (pos1 and pos1.x and pos2 and pos2.x) then
return false
end