Ver código fonte

bugfix in clone()

Nicolas Cannasse 11 anos atrás
pai
commit
c53a52ba33
1 arquivos alterados com 1 adições e 5 exclusões
  1. 1 5
      h3d/mat/Material.hx

+ 1 - 5
h3d/mat/Material.hx

@@ -74,11 +74,7 @@ class Material {
 		#if debug
 		#if debug
 		if( Type.getClass(m) != Type.getClass(this) ) throw this + " is missing clone()";
 		if( Type.getClass(m) != Type.getClass(this) ) throw this + " is missing clone()";
 		#end
 		#end
-		var p = passes;
-		while( p != null ) {
-			m.addPass(p.clone());
-			p = p.nextPass;
-		}
+		// DO NOT clone passes (it's up to the superclass to recreate the shaders)
 		m.castShadows = castShadows;
 		m.castShadows = castShadows;
 		m.receiveShadows = receiveShadows;
 		m.receiveShadows = receiveShadows;
 		return m;
 		return m;