Browse Source

random Cpp fix

Simon Krajewski 13 years ago
parent
commit
887b4f70b7
1 changed files with 1 additions and 0 deletions
  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 {
 	public static function random( x : Int ) : Int {
+		if (x <= 0) return 0;
 		return untyped __global__.__hxcpp_irand(x);
 		return untyped __global__.__hxcpp_irand(x);
 	}
 	}