Explorar el Código

Fixed loadingmanager bug in 'load' event listener

Make sure loadingmanager is aware of errors occured in 'load' event handler
Pontus Leitzler hace 10 años
padre
commit
8fabfa6852
Se han modificado 1 ficheros con 5 adiciones y 3 borrados
  1. 5 3
      src/loaders/XHRLoader.js

+ 5 - 3
src/loaders/XHRLoader.js

@@ -45,17 +45,19 @@ THREE.XHRLoader.prototype = {
 
 			THREE.Cache.add( url, response );
 
-			if ( this.status == 200 && this.readyState == 4 ) {
+			if ( this.status === 200 && this.readyState === 4 ) {
 
 				if ( onLoad ) onLoad( response );
 
+				scope.manager.itemEnd( url );
+
 			} else {
 
 				if ( onError ) onError( event );
 
-			}
+				scope.manager.itemError( url );
 
-			scope.manager.itemEnd( url );
+			}
 
 		}, false );
 

粤ICP备19079148号