mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-11 08:19:45 +00:00
BiomeArray: check lower bounds in ::idx() as well as upper bounds
This commit is contained in:
parent
ae6a7b7cc9
commit
b3454b3488
@ -43,7 +43,7 @@ final class BiomeArray{
|
||||
}
|
||||
|
||||
private static function idx(int $x, int $z) : int{
|
||||
if($x >= 16 or $z >= 16){
|
||||
if($x < 0 or $x >= 16 or $z < 0 or $z >= 16){
|
||||
throw new \InvalidArgumentException("x and z must be in the range 0-15");
|
||||
}
|
||||
return ($z << 4) | $x;
|
||||
|
Loading…
x
Reference in New Issue
Block a user