This repository was archived by the owner on Mar 29, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -129,8 +129,11 @@ idrinth.land = {
129129 }
130130 document . getElementById ( 'idrinth-land-gold' ) . value = idrinth . settings . get ( "land#gold" ) ;
131131 } ;
132- for ( var key in idrinth . settings . get ( "land" , true ) ) {
133- idrinth . settings . change ( 'land#' + key , parseInt ( document . getElementById ( 'idrinth-land-' + key ) . value , 10 ) ) ;
132+ var landSettings = idrinth . settings . get ( "land" , true ) ;
133+ for ( var key in landSettings ) {
134+ if ( landSettings . hasOwnProperty ( key ) ) {
135+ idrinth . settings . change ( 'land#' + key , parseInt ( document . getElementById ( 'idrinth-land-' + key ) . value , 10 ) ) ;
136+ }
134137 }
135138 var results = baseCalculator ( getRequirements ( ) ) ;
136139 if ( Object . keys ( results ) . length === 0 ) {
Original file line number Diff line number Diff line change @@ -19,11 +19,15 @@ var idrinth = {
1919 reload : function ( ) {
2020 window . clearTimeout ( idrinth . core . timeouts . next ) ;
2121 idrinth . ui . removeElement ( 'idotd-base' ) ;
22- for ( var event in idrinth . core . multibind . events ) {
23- document . getElementsByTagName ( 'body' ) [ 0 ] . removeEventListener ( event , idrinth . core . multibind . triggered ) ;
22+ for ( var event in idrinth . core . multibind . events ) {
23+ if ( idrinth . core . multibind . events . hasOwnProperty ( event ) ) {
24+ document . getElementsByTagName ( 'body' ) [ 0 ] . removeEventListener ( event , idrinth . core . multibind . triggered ) ;
25+ }
2426 }
2527 for ( var observer in idrinth . observer . list ) {
26- idrinth . observer . list [ observer ] . disconnect ( ) ;
28+ if ( idrinth . observer . list . hasOwnProperty ( observer ) ) {
29+ idrinth . observer . list [ observer ] . disconnect ( ) ;
30+ }
2731 }
2832 window . setTimeout ( function ( ) {
2933 idrinth = { } ;
You can’t perform that action at this time.
0 commit comments