mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 06:11:24 +00:00
fix matchpattern when min >= max
This commit is contained in:
+1
@@ -29,6 +29,7 @@ public class MatchPattern implements Pattern {
|
|||||||
public boolean matches(int y, Column<?> column) {
|
public boolean matches(int y, Column<?> column) {
|
||||||
int min = FastMath.max(column.getMinY(), range.getMin() + y);
|
int min = FastMath.max(column.getMinY(), range.getMin() + y);
|
||||||
int max = FastMath.min(column.getMaxY(), range.getMax() + y);
|
int max = FastMath.min(column.getMaxY(), range.getMax() + y);
|
||||||
|
if(max <= min) return false;
|
||||||
for(int i = min; i < max; i++) {
|
for(int i = min; i < max; i++) {
|
||||||
if(!matches.test(column.getBlock(i))) return false;
|
if(!matches.test(column.getBlock(i))) return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user