From b9ff50c5cc2f2731c47888114185d6abe4955c3f Mon Sep 17 00:00:00 2001 From: Ali El Gariani Date: Mon, 28 Apr 2008 16:25:23 +0000 Subject: [PATCH] Fix some bugs with the undocumented location-specific terrain rules: - x and y values were shifted by 1 - other [tile] requirements were ignored --- src/builder.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/builder.cpp b/src/builder.cpp index d7a423444c6..5c8b975940c 100644 --- a/src/builder.cpp +++ b/src/builder.cpp @@ -681,7 +681,7 @@ void terrain_builder::parse_config(const config &cfg) // 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()); @@ -927,11 +927,6 @@ void terrain_builder::build_terrains() 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 // and later try to apply the rule only on them