fix: 1.103.02 - parse old .map - markers data fix

This commit is contained in:
Azgaar 2024-09-04 22:30:24 +02:00
parent 637aa398bb
commit 0b8d3c63fc
4 changed files with 7 additions and 5 deletions

View file

@ -117,6 +117,7 @@ window.Markers = (function () {
while (quantity && candidates.length) {
const [cell] = extractAnyElement(candidates);
const marker = addMarker({icon, type, dx, dy, px}, {cell});
if (!marker) continue;
add("marker" + marker.i, cell);
quantity--;
}
@ -150,6 +151,7 @@ window.Markers = (function () {
}
function addMarker(base, marker) {
if (marker.cell === undefined) return;
const i = last(pack.markers)?.i + 1 || 0;
const [x, y] = getMarkerCoordinates(marker.cell);
marker = {...base, x, y, ...marker, i};