2
0
Nicolas Cannasse 4 жил өмнө
parent
commit
ff4d61430f

+ 1 - 1
hrt/impl/Macros.hx

@@ -46,7 +46,7 @@ class Macros {
 				}
 
 				if( serCond == null ) {
-					var defVal = e.expr.match(EConst(_)) ? e : macro null;
+					var defVal = e.expr.match(EConst(_) | EBinop(_) | EUnop(_)) ? e : macro @:pos(f.pos) null;
 					serCond = macro @:pos(pos) this.$name != $defVal;
 				}
 

+ 6 - 1
hrt/prefab/l2d/NoiseGenerator.hx

@@ -14,7 +14,7 @@ enum abstract RepeatMode(String) {
 
 class NoiseGenerator extends Prefab {
 
-	@:s public var seed : Int = Std.random(100);
+	@:s public var seed : Int;
 
 	@:s public var mode : NoiseMode = Perlin;
 
@@ -37,6 +37,11 @@ class NoiseGenerator extends Prefab {
 
 	var tex : h3d.mat.Texture;
 
+	function new(?parent) {
+		super(parent);
+		seed = Std.random(100);
+	}
+
 	public function updateTexture( t : h3d.mat.Texture ) {
 		var e = h3d.Engine.getCurrent();
 		e.pushTarget(t);