Removed unnecessary warnings about replace area requirement-related

properties.
Added code to clear the "isApplied" flag on a replace area when another
replace area is applied later and intersects with the first one.
This commit is contained in:
Zukero
2017-10-02 16:32:31 +02:00
parent e0c7dd35b8
commit 60edd73fc2
2 changed files with 9 additions and 1 deletions

View File

@@ -186,6 +186,13 @@ public final class MapController {
if (!satisfiesCondition(replacement)) continue;
else ConversationController.requirementFulfilled(world, replacement.requirement);
tileMap.applyReplacement(replacement);
for (ReplaceableMapSection impactedReplacement : tileMap.replacements) {
if (impactedReplacement.isApplied && impactedReplacement.replacementArea.intersects(replacement.replacementArea)) {
//The applied replacement has overwritten changes made by a previously applied replacement.
//This previous replacement must now be considered as unapplied to let it be reapplied later eventually.
impactedReplacement.isApplied = false;
}
}
hasUpdated = true;
}
}

View File

@@ -288,7 +288,8 @@ public final class TMXMapTranslator {
else if (prop.name.equalsIgnoreCase(LAYERNAME_ABOVE)) layerNames.aboveLayersName = prop.value;
else if (prop.name.equalsIgnoreCase(LAYERNAME_WALKABLE)) layerNames.walkableLayersName = prop.value;
else if (AndorsTrailApplication.DEVELOPMENT_VALIDATEDATA) {
L.log("OPTIMIZE: Map " + map.name + " contains replace area with unknown property \"" + prop.name + "\".");
if (!requirementPropertiesNames.contains(prop.name))
L.log("OPTIMIZE: Map " + map.name + " contains replace area with unknown property \"" + prop.name + "\".");
}
}
MapSection replacementSection = transformMapSection(map, tileCache, position, layersPerLayerName, usedTileIDs, layerNames);