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:
Dylan K. Taylor 2017-12-26 14:31:42 +00:00
parent 3c4dca7fdb
commit dda71b06ae

View File

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