datsexyanon

asdfjkl;

May 16th, 2014
406
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.17 KB | None | 0 0
  1. function on_anoms_tbl(t)
  2.     anom_tbl=t
  3.     -- для динамического обновления данных о состоянии объектов(объект сместился, рандомная аномалия отключилась/включилась)
  4.     know_objs={}
  5. end
  6.  
  7. function obj_in_anom(obj)
  8.     if anom_tbl==nil then
  9. --      get_console():execute("Нет_данных_о_наличие_аномалий_на_локации")
  10.         return false
  11.     end
  12.     if anom_tbl==0 or know_objs[obj] then
  13. --      get_console():execute("Схема_[watcher_act]_деактивирована")
  14.         return true
  15.     end
  16. --  level.map_remove_object_spot(obj:id(), "green_location")
  17. --  get_console():execute("debug_msg:"..(string.format("Неписи_знают_аномалий==%d",table.getn(anom_tbl))))
  18.     local obj_pos=obj:position()
  19.     for i,v in pairs(anom_tbl) do
  20.         local anom=level.object_by_id(v)
  21.         if anom and obj_pos:distance_to(anom:position())<3 then
  22. --          level.map_add_object_spot(obj:id(), "green_location", "Объект: ["..(obj:section()).."] опасно близко к аномалии: ["..(anom:section()).."]")
  23.             know_objs[obj]=true
  24.             return true
  25.         end
  26.     end
  27.     return false
  28. end
Advertisement
Add Comment
Please, Sign In to add comment