Explorar el Código

random Cpp fix

Simon Krajewski hace 13 años
padre
commit
887b4f70b7
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  1. 1 0
      std/cpp/_std/Std.hx

+ 1 - 0
std/cpp/_std/Std.hx

@@ -45,6 +45,7 @@
 	}
 
 	public static function random( x : Int ) : Int {
+		if (x <= 0) return 0;
 		return untyped __global__.__hxcpp_irand(x);
 	}