SHARE
TWEET

Untitled

a guest Jun 16th, 2018 4 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function areas:getAreasAtPos(pos)
  2.         local res = {}
  3.         if self.store then
  4.                 local a = self.store:get_areas_for_pos(pos, false, true)
  5.                 for store_id, store_area in pairs(a) do
  6.                         local id = tonumber(store_area.data)
  7.                         res[id] = self.areas[id]
  8.                 end
  9.         else
  10.                 local px, py, pz = pos.x, pos.y, pos.z
  11.                 for id, area in pairs(self.areas) do
  12.                         local ap1, ap2 = area.pos1, area.pos2
  13.                         if
  14.                                         (px >= ap1.x and px <= ap2.x) and
  15.                                         (py >= ap1.y and py <= ap2.y) and
  16.                                         (pz >= ap1.z and pz <= ap2.z) then
  17.                                 res[id] = area
  18.                         end
  19.                 end
  20.         end
  21.         return res
  22. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top