Closed melek closed 1 year ago
Resolved in 1.0rc with the following fix per Discord:
loadElevationLayer
macro in macro group 1.2 - Elevation Layer UDFs[h, if(json.type(vLayerVBL) == "ARRAY" && json.length(vLayerVBL) > 0):
vHasVBL = json.length(json.get(json.get(vLayerVBL, 0), "points"));
vHasVBL = 0]
[h, if(json.type(vLayerMBL) == "ARRAY" && json.length(vLayerMBL) > 0):
vHasMBL = json.length(json.get(json.get(vLayerMBL, 0), "points"));
vHasMBL = 0]
[h, if(json.type(vLayerPitVBL) == "ARRAY" && json.length(vLayerPitVBL) > 0):
vHasPitVBL = json.length(json.get(json.get(vLayerPitVBL, 0), "points"));
vHasPitVBL = 0]
[h, if(json.type(vLayerHillVBL) == "ARRAY" && json.length(vLayerHillVBL) > 0):
vHasHillVBL = json.length(json.get(json.get(vLayerHillVBL, 0), "points"));
vHasHillVBL = 0]
Bug
When changing elevations in MapTool 1.12b3, all elevation data may be lost from the elevation you are switching from.
Cause
This is because the
getVBL
type functions used to return an empty shape object if there were no points to record. Now, instead, it returns an empty JSON array[]
.The library needs to account for this case so it doesn't silently fail.
Workaround
On Lib:Elevation 1.0b8, you must add at least one point of every blocking layer type (VBL, Pit VBL, Hill VBL, and MBL) to a map elevation before switching away from it, or you will lose all of that elevation's data.