Save the running world before importing a world file (t79)

This commit is contained in:
2026-10-29 17:52:24 -04:00
parent 5e26e4634d
commit cf762268ce
3 changed files with 97 additions and 0 deletions
+4
View File
@@ -184,6 +184,10 @@ async function exportWorld() {
catch (e) { if (e && e.code !== 'declined') toast('The world file was not saved.'); }
}
async function importWorldFile(file) {
if (GAME.running && !await saveWorld('auto', true)) {
toast('The current world could not be saved. Import cancelled.');
return;
}
const progress = (f, s) => showLoading(true, f, s, 'Loading world');
progress(0.05, 'Reading the save');
try {