Advertisement
alestane

proximity check

Jul 10th, 2013
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.25 KB | None | 0 0
  1. local function performSpotCheck(L1, L2)
  2.     spotCheck = 'BAD'
  3.     if L1.state == "unspent" and L2 then
  4.         local dX, dY = math.abs(L1.x - L2.x), math.abs(L1.y - L2.y)
  5.         if dX <= 112 and dY <= 112 then
  6.             spotCheck = 'OK'
  7.         end
  8.     end
  9.     return spotCheck
  10. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement