Răsfoiți Sursa

bugfix in clone()

Nicolas Cannasse 11 ani în urmă
părinte
comite
c53a52ba33
1 a modificat fișierele cu 1 adăugiri și 5 ștergeri
  1. 1 5
      h3d/mat/Material.hx

+ 1 - 5
h3d/mat/Material.hx

@@ -74,11 +74,7 @@ class Material {
 		#if debug
 		if( Type.getClass(m) != Type.getClass(this) ) throw this + " is missing clone()";
 		#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.receiveShadows = receiveShadows;
 		return m;