Author: alink
Date: Mon Apr 28 18:25:23 2008
New Revision: 26211

URL: http://svn.gna.org/viewcvs/wesnoth?rev=26211&view=rev
Log:
Fix some bugs with the undocumented location-specific terrain rules:
- x and y values were shifted by 1
- other [tile] requirements were ignored

Modified:
    trunk/src/builder.cpp

Modified: trunk/src/builder.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/builder.cpp?rev=26211&r1=26210&r2=26211&view=diff
==============================================================================
--- trunk/src/builder.cpp (original)
+++ trunk/src/builder.cpp Mon Apr 28 18:25:23 2008
@@ -681,7 +681,7 @@
                // add_images_from_config(pbr.images, **br);
 
                if(!((**br)["x"].empty() || (**br)["y"].empty()))
-                       pbr.location_constraints = 
gamemap::location(atoi((**br)["x"].c_str()), atoi((**br)["y"].c_str()));
+                       pbr.location_constraints = 
gamemap::location(atoi((**br)["x"].c_str())-1, atoi((**br)["y"].c_str())-1);
 
                pbr.probability = (**br)["probability"].empty() ? -1 : 
atoi((**br)["probability"].c_str());
                pbr.precedence = (**br)["precedence"].empty() ? 0 : 
atoi((**br)["precedence"].c_str());
@@ -926,11 +926,6 @@
        for(r = building_rules_.begin(); r != building_rules_.end(); ++r) {
 
                const building_rule& rule = r->second;
-
-               if (rule.location_constraints.valid()) {
-                       apply_rule(rule, rule.location_constraints);
-                       continue;
-               }
 
                // Find the constraint that contains the less terrain of all 
terrain rules.
                // We will keep a track of the matching terrains of this 
constraint


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

Reply via email to