From c56d294a1774d585bede803ef5cb9a2fd1157d80 Mon Sep 17 00:00:00 2001 From: Ardenian Date: Sat, 8 Apr 2017 22:34:44 +0200 Subject: [PATCH 1/3] fixes #302 fixes #298 fixes 301 --- src/mods/land.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mods/land.js b/src/mods/land.js index 7224cee..2cec3ee 100644 --- a/src/mods/land.js +++ b/src/mods/land.js @@ -130,7 +130,9 @@ 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 ) ); + if ( idrinth.settings.get( "land", true ).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 ) { From ccf127c4d3c4d4253a4fa9e8c71844cb4072a49f Mon Sep 17 00:00:00 2001 From: Ardenian Date: Sat, 8 Apr 2017 22:35:22 +0200 Subject: [PATCH 2/3] fixes guard-in --- src/stable.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 = { }; From 5434aaf8b789401ad04d7331bcfad3fd5de3726e Mon Sep 17 00:00:00 2001 From: Ardenian Date: Mon, 10 Apr 2017 15:49:06 +0200 Subject: [PATCH 3/3] storing request in variable --- src/mods/land.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mods/land.js b/src/mods/land.js index 2cec3ee..8f42bb1 100644 --- a/src/mods/land.js +++ b/src/mods/land.js @@ -129,8 +129,9 @@ idrinth.land = { } document.getElementById ( 'idrinth-land-gold' ).value = idrinth.settings.get ( "land#gold" ); }; - for (var key in idrinth.settings.get ( "land", true )) { - if ( idrinth.settings.get( "land", true ).hasOwnProperty( key ) ) { + 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 ) ); } }