Author: anonymissimus
Date: Sun Feb 27 16:29:11 2011
New Revision: 48674

URL: http://svn.gna.org/viewcvs/wesnoth?rev=48674&view=rev
Log:
Introduced [move_unit]ignore_passability= (default no, previously it was always 
no/non-existant) key to allow disabling the check for suitable terrain.

Modified:
    trunk/changelog
    trunk/data/lua/wml-tags.lua

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=48674&r1=48673&r2=48674&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Sun Feb 27 16:29:11 2011
@@ -45,6 +45,8 @@
      (post) advance events and an ignore_passability= (default no, previously 
it was
      always yes/non-existant) key controlling whether to check for suitable 
terrain
      when placing units
+   * Introduced [move_unit]ignore_passability= (default no, previously it was
+     always no/non-existant) key to allow disabling the check for suitable 
terrain.
  * Miscellaneous and bugfixes:
    * Fixed: g++ compiler warnings.
    * Added: cmake target to build the gui design pdf.

Modified: trunk/data/lua/wml-tags.lua
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/lua/wml-tags.lua?rev=48674&r1=48673&r2=48674&view=diff
==============================================================================
--- trunk/data/lua/wml-tags.lua (original)
+++ trunk/data/lua/wml-tags.lua Sun Feb 27 16:29:11 2011
@@ -556,13 +556,15 @@
                        local xs, ys = string.gmatch(to_x, pattern), 
string.gmatch(to_y, pattern)
                        local move_string_x = current_unit.x
                        local move_string_y = current_unit.y
+                       local pass_check = current_unit
+                       if cfg.ignore_passability then pass_check = nil end
 
                        local x, y = xs(), ys()
                        while true do
                                x = tonumber(x) or 
helper.wml_error(coordinate_error)
                                y = tonumber(y) or 
helper.wml_error(coordinate_error)
-                               x, y = wesnoth.find_vacant_tile(x, y, 
current_unit)
-                               if not x or not y then helper.wml_error("Could 
not find a reachable vacant hex near to one of the target hexes in 
[move_unit].") end
+                               x, y = wesnoth.find_vacant_tile(x, y, 
pass_check)
+                               if not x or not y then helper.wml_error("Could 
not find a suitable hex near to one of the target hexes in [move_unit].") end
                                move_string_x = string.format("%s,%u", 
move_string_x, x)
                                move_string_y = string.format("%s,%u", 
move_string_y, y)
                                local next_x, next_y = xs(), ys()


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to