mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
ensure marker id is unique
This commit is contained in:
parent
6ad2f34639
commit
c20bcc1502
2 changed files with 26 additions and 1 deletions
|
|
@ -97,7 +97,7 @@ window.Markers = (function () {
|
|||
}
|
||||
|
||||
function addMarker({cell, type, icon, dx, dy, px}) {
|
||||
const i = pack.markers.length;
|
||||
const i = last(pack.markers)?.i + 1 || 0;
|
||||
const [x, y] = getMarkerCoordinates(cell);
|
||||
const marker = {i, icon, type, x, y, cell};
|
||||
if (dx) marker.dx = dx;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue