Author: anonymissimus
Date: Sun Feb 27 18:56:05 2011
New Revision: 48676

URL: http://svn.gna.org/viewcvs/wesnoth?rev=48676&view=rev
Log:
Renamed ignore_passability= in [teleport], [move_unit] and [unstore_unit] to 
check_passability= to get rid of the confusing negation as long as they're not 
used yet. Adjusted default values accordingly. Breaks backwards compatibility 
in case of [teleport], there are however no usages of the key in mainline wml.

Modified:
    trunk/changelog
    trunk/data/lua/wml-tags.lua
    trunk/src/game_events.cpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=48676&r1=48675&r2=48676&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Sun Feb 27 18:56:05 2011
@@ -42,11 +42,13 @@
      opposed to mixing the leader's attributes with the side attributes.
    * New wml action tag [transform_unit], like the {TRANSFORM_UNIT..} macro.
    * [unstore_unit] now accepts a fire_event= key to control firing of
-     (post) advance events and an ignore_passability= (default no, previously 
it was
-     always yes/non-existant) key controlling whether to check for suitable 
terrain
+     (post) advance events and a check_passability= (default yes, previously 
it was
+     always no/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.
+   * Renamed [teleport]ignore_passability= to check_passability= to get rid of
+     a confusing negation.
+   * Introduced [move_unit]check_passability= (default yes, previously it was
+     always yes/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=48676&r1=48675&r2=48676&view=diff
==============================================================================
--- trunk/data/lua/wml-tags.lua (original)
+++ trunk/data/lua/wml-tags.lua Sun Feb 27 18:56:05 2011
@@ -546,6 +546,7 @@
        local to_x = tostring(cfg.to_x) or helper.wml_error(coordinate_error)
        local to_y = tostring(cfg.to_y) or helper.wml_error(coordinate_error)
        local fire_event = cfg.fire_event
+       local check_passability = cfg.check_passability; if check_passability 
== nil then check_passability = true end
        cfg = helper.literal(cfg)
        cfg.to_x, cfg.to_y, cfg.fire_event = nil, nil, nil
        local units = wesnoth.get_units(cfg)
@@ -556,8 +557,8 @@
                        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 pass_check = nil
+                       if check_passability then pass_check = current_unit end
 
                        local x, y = xs(), ys()
                        while true do

Modified: trunk/src/game_events.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_events.cpp?rev=48676&r1=48675&r2=48676&view=diff
==============================================================================
--- trunk/src/game_events.cpp (original)
+++ trunk/src/game_events.cpp Sun Feb 27 18:56:05 2011
@@ -623,9 +623,9 @@
        const map_location dst = cfg_to_loc(cfg);
        if (dst == u->get_location() || !resources::game_map->on_board(dst)) 
return;
 
-       const unit *pass_check = &*u;
-       if (cfg["ignore_passability"].to_bool())
-               pass_check = NULL;
+       const unit* pass_check = NULL;
+       if (cfg["check_passability"].to_bool(true))
+               pass_check = &*u;
        const map_location vacant_dst = find_vacant_tile(*resources::game_map, 
*resources::units, dst, pathfind::VACANT_ANY, pass_check);
        if (!resources::game_map->on_board(vacant_dst)) return;
 
@@ -2026,8 +2026,8 @@
                        (cfg.has_attribute("x") && cfg.has_attribute("y")) ? 
cfg : vconfig(var));
                if(loc.valid()) {
                        if (cfg["find_vacant"].to_bool()) {
-                               const unit* pass_check = &u;
-                               if (cfg["ignore_passability"].to_bool(false)) 
pass_check = 0;
+                               const unit* pass_check = NULL;
+                               if (cfg["check_passability"].to_bool(true)) 
pass_check = &u;
                                loc = pathfind::find_vacant_tile(
                                                *resources::game_map,
                                                *resources::units,


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

Reply via email to