Skip to content

Commit a2e0764

Browse files
committed
Improve void map repeat bugfix
1 parent 9259fa8 commit a2e0764

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

modules/maps.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -239,15 +239,15 @@ function autoMaps() {
239239
if (_vanillaMAZ()) return;
240240
if (_stormDisableMapping()) return;
241241

242-
_autoMapsDefaults();
242+
const mapObj = getCurrentMapObject();
243+
_autoMapsDefaults(mapObj);
243244

244245
const mapsOwned = _checkOwnedMaps();
245246

246247
_searchForUniqueMaps(mapsOwned.uniqueMapsOwned, mapsOwned.runUnique);
247248

248249
mapsOwned.selectedMap = _setSelectedMap(mapsOwned.selectedMap, mapsOwned.voidMap, mapsOwned.optimalMap);
249250

250-
const mapObj = getCurrentMapObject();
251251
if (game.global.mapsActive) _setMapRepeat(mapObj);
252252

253253
if (!game.global.preMapsActive && !game.global.mapsActive && mapsOwned.selectedMap !== 'world') {
@@ -357,13 +357,18 @@ function _lifeMapping() {
357357
MODULES.maps.lifeActive = false;
358358
}
359359

360-
function _autoMapsDefaults() {
360+
function _autoMapsDefaults(mapObj = getCurrentMapObject()) {
361361
if (!game.global.mapsActive && !game.global.preMapsActive) {
362362
game.global.mapRunCounter = 0;
363363
MODULES.maps.mapTimer = 0;
364364
} else {
365-
if (game.options.menu.exitTo.enabled) toggleSetting('exitTo');
366-
if (mapSettings.mapName === 'Void Maps' && game.options.menu.repeatVoids.enabled) toggleSetting('repeatVoids');
365+
if (game.options.menu.exitTo.enabled) {
366+
toggleSetting('exitTo');
367+
}
368+
369+
if (mapObj && mapObj.location === 'Void' && game.options.menu.repeatVoids.enabled === 1 && mapSettings.mapName !== 'Void Map') {
370+
toggleSetting('repeatVoids');
371+
}
367372
}
368373
}
369374

@@ -542,10 +547,6 @@ function _setMapRepeat(mapObj = getCurrentMapObject()) {
542547
repeatState = false;
543548
}
544549

545-
if (mapObj.location === 'Void' && game.options.menu.repeatVoids.enabled === 1 && mapSettings.mapName !== 'Void Map') {
546-
toggleSetting('repeatVoids');
547-
}
548-
549550
if (game.global.repeatMap !== repeatState) {
550551
repeatClicked();
551552
}

0 commit comments

Comments
 (0)