mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-01 23:59:53 +00:00
Fix division by zero when the server goes too fast
This commit is contained in:
parent
e06092cb99
commit
bb34e06754
@ -2073,7 +2073,7 @@ class Server{
|
|||||||
|
|
||||||
$now = microtime(true);
|
$now = microtime(true);
|
||||||
array_shift($this->tickAverage);
|
array_shift($this->tickAverage);
|
||||||
$this->tickAverage[] = min(20, 1 / ($now - $tickTime));
|
$this->tickAverage[] = min(20, 1 / max(0.001, $now - $tickTime));
|
||||||
array_shift($this->useAverage);
|
array_shift($this->useAverage);
|
||||||
$this->useAverage[] = min(1, ($now - $tickTime) / 0.05);
|
$this->useAverage[] = min(1, ($now - $tickTime) / 0.05);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user