mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
fix: 1.103.02 - parse old .map - markers data fix
This commit is contained in:
parent
637aa398bb
commit
0b8d3c63fc
4 changed files with 7 additions and 5 deletions
|
|
@ -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};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue