mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-18 11:45:30 +00:00
Another 64-bit patch
This commit is contained in:
parent
29ab53a46f
commit
731fbbc8d1
@ -47,7 +47,7 @@ class Random{
|
|||||||
* @param int $seed Integer to be used as seed.
|
* @param int $seed Integer to be used as seed.
|
||||||
*/
|
*/
|
||||||
public function setSeed($seed){
|
public function setSeed($seed){
|
||||||
$seed = crc32($seed) % 0x7fffffff;
|
$seed = crc32($seed);
|
||||||
$this->x = $seed ^ 0x0badc0de;
|
$this->x = $seed ^ 0x0badc0de;
|
||||||
$this->z = $seed ^ -123456789;
|
$this->z = $seed ^ -123456789;
|
||||||
$this->y = $seed ^ 0x12345678;
|
$this->y = $seed ^ 0x12345678;
|
||||||
@ -91,7 +91,7 @@ class Random{
|
|||||||
* @return float
|
* @return float
|
||||||
*/
|
*/
|
||||||
public function nextFloat(){
|
public function nextFloat(){
|
||||||
return $this->nextInt() / 0x7FFFFFFF;
|
return $this->nextInt() / 0x7fffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -100,7 +100,7 @@ class Random{
|
|||||||
* @return float
|
* @return float
|
||||||
*/
|
*/
|
||||||
public function nextSignedFloat(){
|
public function nextSignedFloat(){
|
||||||
return $this->nextSignedInt() / 0x7FFFFFFF;
|
return $this->nextSignedInt() / 0x7fffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user