Fix inhabited time check

This commit is contained in:
Lukas Rieger (Blue) 2022-12-17 15:10:22 +01:00
parent cf93cb56c4
commit c7fc230dcf
No known key found for this signature in database
GPG Key ID: 2D09EC5ED2687FF2

View File

@ -160,7 +160,7 @@ private boolean tileRenderPreconditions(Vector2i tile) {
for (int z = minChunk.getY(); z <= maxChunk.getY(); z++) {
Chunk chunk = map.getWorld().getChunk(x, z);
if (!chunk.isGenerated()) return false;
if (chunk.getInhabitedTime() < minInhab) isInhabited = true;
if (chunk.getInhabitedTime() >= minInhab) isInhabited = true;
}
}
@ -168,7 +168,10 @@ private boolean tileRenderPreconditions(Vector2i tile) {
for (int x = minChunk.getX() - minInhabRadius; x <= maxChunk.getX() + minInhabRadius; x++) {
for (int z = minChunk.getY() - minInhabRadius; z <= maxChunk.getY() + minInhabRadius; z++) {
Chunk chunk = map.getWorld().getChunk(x, z);
if (chunk.getInhabitedTime() < minInhab) isInhabited = true;
if (chunk.getInhabitedTime() >= minInhab) {
isInhabited = true;
break;
}
}
}
}