Vultraz

Untitled

Mar 29th, 2015
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1.     [lua]
  2.         code = <<
  3.             local respawn_point
  4.             local radius = 1
  5.  
  6.             repeat
  7.                 respawn_point = wesnoth.get_locations {
  8.                     "include_borders" = false,
  9.                     { "and",
  10.                         { "filter",
  11.                             { "id" = wesnoth.get_variable("respawn_hub") }
  12.                         },
  13.                         "radius" = radius
  14.                     },
  15.                     { "and" ,
  16.                         { "not",
  17.                             { "filter", {} }
  18.                         },
  19.                         { "not",
  20.                             { "terrain" = "Wo,*^Xm,X*,Q*" }
  21.                         }
  22.                     }
  23.                 }
  24.  
  25.                 radius = radius + 1
  26.             until respawn_point ~= false
  27.  
  28.             wesnoth.set_variable("respawn_point.x" respawn_point.x)
  29.             wesnoth.set_variable("respawn_point.y" respawn_point.y)
  30.         >>
  31.     [/lua]
Advertisement
Add Comment
Please, Sign In to add comment