mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
AxisAlignedBB: Use elseif in calculate*Offset()
It's impossible for both of these conditions to be met in the same call.
This commit is contained in:
parent
3c4dca7fdb
commit
dda71b06ae
@ -226,8 +226,7 @@ class AxisAlignedBB{
|
||||
if($x1 < $x){
|
||||
$x = $x1;
|
||||
}
|
||||
}
|
||||
if($x < 0 and $bb->minX >= $this->maxX){
|
||||
}elseif($x < 0 and $bb->minX >= $this->maxX){
|
||||
$x2 = $this->maxX - $bb->minX;
|
||||
if($x2 > $x){
|
||||
$x = $x2;
|
||||
@ -249,8 +248,7 @@ class AxisAlignedBB{
|
||||
if($y1 < $y){
|
||||
$y = $y1;
|
||||
}
|
||||
}
|
||||
if($y < 0 and $bb->minY >= $this->maxY){
|
||||
}elseif($y < 0 and $bb->minY >= $this->maxY){
|
||||
$y2 = $this->maxY - $bb->minY;
|
||||
if($y2 > $y){
|
||||
$y = $y2;
|
||||
@ -272,8 +270,7 @@ class AxisAlignedBB{
|
||||
if($z1 < $z){
|
||||
$z = $z1;
|
||||
}
|
||||
}
|
||||
if($z < 0 and $bb->minZ >= $this->maxZ){
|
||||
}elseif($z < 0 and $bb->minZ >= $this->maxZ){
|
||||
$z2 = $this->maxZ - $bb->minZ;
|
||||
if($z2 > $z){
|
||||
$z = $z2;
|
||||
|
Loading…
x
Reference in New Issue
Block a user