mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-02-04 17:41:23 +01:00
fix: clean up neighbors references on state removal
This commit is contained in:
parent
844fc15891
commit
ed3cc83fed
3 changed files with 8 additions and 2 deletions
|
|
@ -640,6 +640,12 @@ function stateRemove(stateId) {
|
||||||
});
|
});
|
||||||
armies.select("g#army" + stateId).remove();
|
armies.select("g#army" + stateId).remove();
|
||||||
|
|
||||||
|
// clean up neighbors references from other states
|
||||||
|
pack.states.forEach(state => {
|
||||||
|
if (!state.i || state.removed || !state.neighbors) return;
|
||||||
|
state.neighbors = state.neighbors.filter(n => n !== stateId);
|
||||||
|
});
|
||||||
|
|
||||||
pack.states[stateId] = {i: stateId, removed: true};
|
pack.states[stateId] = {i: stateId, removed: true};
|
||||||
|
|
||||||
debug.selectAll(".highlight").remove();
|
debug.selectAll(".highlight").remove();
|
||||||
|
|
|
||||||
|
|
@ -991,7 +991,7 @@ function refreshAllEditors() {
|
||||||
// dynamically loaded editors
|
// dynamically loaded editors
|
||||||
async function editStates() {
|
async function editStates() {
|
||||||
if (customization) return;
|
if (customization) return;
|
||||||
const Editor = await import("../dynamic/editors/states-editor.js?v=1.108.1");
|
const Editor = await import("../dynamic/editors/states-editor.js?v=1.112.1");
|
||||||
Editor.open();
|
Editor.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
* Example: 1.102.2 -> Major version 1, Minor version 102, Patch version 2
|
* Example: 1.102.2 -> Major version 1, Minor version 102, Patch version 2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const VERSION = "1.112.0";
|
const VERSION = "1.112.1";
|
||||||
if (parseMapVersion(VERSION) !== VERSION) alert("versioning.js: Invalid format or parsing function");
|
if (parseMapVersion(VERSION) !== VERSION) alert("versioning.js: Invalid format or parsing function");
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue