mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-09 18:44:14 +00:00
Fix some bugs with the undocumented location-specific terrain rules:
- x and y values were shifted by 1 - other [tile] requirements were ignored
This commit is contained in:
parent
0642efcaf5
commit
b9ff50c5cc
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user