From 34972c3327f099be2c692eb964172fe62a71df15 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 5 Feb 2020 21:00:56 +0000 Subject: [PATCH] Assume that getmypid() never returns false my background research on this informs me that this returns false on negative PID, which never happens because the underlying C API call never fails - not on linux, bsd, or windows. --- .../network/mcpe/protocol/types/RuntimeBlockMapping.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/network/mcpe/protocol/types/RuntimeBlockMapping.php b/src/pocketmine/network/mcpe/protocol/types/RuntimeBlockMapping.php index 3a6f5c54a..e9b5dc41c 100644 --- a/src/pocketmine/network/mcpe/protocol/types/RuntimeBlockMapping.php +++ b/src/pocketmine/network/mcpe/protocol/types/RuntimeBlockMapping.php @@ -123,7 +123,7 @@ final class RuntimeBlockMapping{ */ private static function randomizeTable(array $table) : array{ $postSeed = mt_rand(); //save a seed to set afterwards, to avoid poor quality randoms - mt_srand(getmypid() ?: 0); //Use a seed which is the same on all threads. This isn't a secure seed, but we don't care. + mt_srand(getmypid()); //Use a seed which is the same on all threads. This isn't a secure seed, but we don't care. shuffle($table); mt_srand($postSeed); //restore a good quality seed that isn't dependent on PID return $table;