@@ -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