Author: mog
Date: Thu May 22 21:11:42 2008
New Revision: 26778
URL: http://svn.gna.org/viewcvs/wesnoth?rev=26778&view=rev
Log:
Fix regression in my previous patch and the switch to overlay terrains.
Modified:
trunk/src/map.cpp
Modified: trunk/src/map.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/map.cpp?rev=26778&r1=26777&r2=26778&view=diff
==============================================================================
--- trunk/src/map.cpp (original)
+++ trunk/src/map.cpp Thu May 22 21:11:42 2008
@@ -523,8 +523,10 @@
if(!terrain.empty()) {
new_terrain = terrain[0];
}
-
- set_terrain(location(x2,y2), new_terrain, mode,
utils::string_bool(cfg["replace_if_failed"]));
+
+ if(!utils::string_bool(cfg["use_old"])) {
+ set_terrain(location(x2,y2),
new_terrain, mode, utils::string_bool(cfg["replace_if_failed"]));
+ }
} else {
set_terrain(location(x2,y2),t);
@@ -858,8 +860,9 @@
result = t;
}
}
- else if(mode == BOTH) {
- if(new_t.base != t_translation::NO_LAYER &&
tcodeToTerrain_.count(new_t) > 0) {
+ else if(mode == BOTH && new_t.base != t_translation::NO_LAYER) {
+ // We need to merge here, too, because the dest terrain might
be a combined one.
+ if (try_merge_terrains(new_t)) {
result = new_t;
}
}
@@ -869,7 +872,10 @@
// or with (default base)^(new overlay)
if(result == t_translation::NONE_TERRAIN && replace_if_failed &&
tcodeToTerrain_.count(new_t) > 0) {
if(new_t.base != t_translation::NO_LAYER) {
- result = new_t;
+ // Same as above
+ if (try_merge_terrains(new_t)) {
+ result = new_t;
+ }
}
else if (get_terrain_info(new_t).default_base() !=
t_translation::NONE_TERRAIN) {
result =
get_terrain_info(new_t).terrain_with_default_base();
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits