mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Liquid: fix max cost calculation for flow direction search, closes #2995
This commit is contained in:
parent
77a4393c7b
commit
11fc16617a
@ -32,6 +32,7 @@ use pocketmine\level\sound\FizzSound;
|
||||
use pocketmine\math\AxisAlignedBB;
|
||||
use pocketmine\math\Vector3;
|
||||
use function array_fill;
|
||||
use function intdiv;
|
||||
use function lcg_value;
|
||||
use function min;
|
||||
|
||||
@ -372,7 +373,7 @@ abstract class Liquid extends Transparent{
|
||||
*/
|
||||
private function getOptimalFlowDirections() : array{
|
||||
$flowCost = array_fill(0, 4, 1000);
|
||||
$maxCost = 4 / $this->getFlowDecayPerBlock();
|
||||
$maxCost = intdiv(4, $this->getFlowDecayPerBlock());
|
||||
for($j = 0; $j < 4; ++$j){
|
||||
$x = $this->x;
|
||||
$y = $this->y;
|
||||
|
Loading…
x
Reference in New Issue
Block a user