diff --git a/src/mods/land.js b/src/mods/land.js index 7224cee..8f42bb1 100644 --- a/src/mods/land.js +++ b/src/mods/land.js @@ -129,8 +129,11 @@ idrinth.land = { } document.getElementById ( 'idrinth-land-gold' ).value = idrinth.settings.get ( "land#gold" ); }; - for (var key in idrinth.settings.get ( "land", true )) { - idrinth.settings.change ( 'land#' + key, parseInt ( document.getElementById ( 'idrinth-land-' + key ).value, 10 ) ); + var landSettings = idrinth.settings.get( "land", true ); + for (var key in landSettings ) { + if ( landSettings.hasOwnProperty( key ) ) { + idrinth.settings.change( 'land#' + key, parseInt( document.getElementById( 'idrinth-land-' + key ).value, 10 ) ); + } } var results = baseCalculator ( getRequirements () ); if ( Object.keys ( results ).length === 0 ) { diff --git a/src/stable.js b/src/stable.js index a657959..64a2a1e 100644 --- a/src/stable.js +++ b/src/stable.js @@ -19,11 +19,15 @@ var idrinth = { reload: function ( ) { window.clearTimeout ( idrinth.core.timeouts.next ); idrinth.ui.removeElement ( 'idotd-base' ); - for (var event in idrinth.core.multibind.events) { - document.getElementsByTagName ( 'body' )[0].removeEventListener ( event, idrinth.core.multibind.triggered ); + for ( var event in idrinth.core.multibind.events ) { + if ( idrinth.core.multibind.events.hasOwnProperty( event ) ) { + document.getElementsByTagName( 'body' )[0].removeEventListener( event, idrinth.core.multibind.triggered ); + } } for (var observer in idrinth.observer.list) { - idrinth.observer.list[observer].disconnect(); + if ( idrinth.observer.list.hasOwnProperty( observer ) ) { + idrinth.observer.list[observer].disconnect(); + } } window.setTimeout ( function () { idrinth = { };