BiomeArray: check lower bounds in ::idx() as well as upper bounds

This commit is contained in:
Dylan K. Taylor 2020-05-16 18:42:47 +01:00
parent ae6a7b7cc9
commit b3454b3488

View File

@ -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;