fix "upgrade square is not fully inside of area" error
This commit is contained in:
@@ -35,12 +35,14 @@ void ChunksController::update(
|
|||||||
int64_t maxDuration, int loadDistance, uint padding, Player& player
|
int64_t maxDuration, int loadDistance, uint padding, Player& player
|
||||||
) const {
|
) const {
|
||||||
const auto& position = player.getPosition();
|
const auto& position = player.getPosition();
|
||||||
int centerX = floordiv<CHUNK_W>(position.x);
|
int centerX = floordiv<CHUNK_W>(glm::floor(position.x));
|
||||||
int centerY = floordiv<CHUNK_D>(position.z);
|
int centerY = floordiv<CHUNK_D>(glm::floor(position.z));
|
||||||
|
|
||||||
if (player.isLoadingChunks()) {
|
if (player.isLoadingChunks()) {
|
||||||
/// FIXME: one generator for multiple players
|
/// FIXME: one generator for multiple players
|
||||||
generator->update(centerX, centerY, loadDistance);
|
generator->update(centerX, centerY, loadDistance);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t mcstotal = 0;
|
int64_t mcstotal = 0;
|
||||||
|
|||||||
@@ -355,8 +355,9 @@ void WorldGenerator::generateHeightmap(
|
|||||||
|
|
||||||
void WorldGenerator::update(int centerX, int centerY, int loadDistance) {
|
void WorldGenerator::update(int centerX, int centerY, int loadDistance) {
|
||||||
surroundMap.setCenter(centerX, centerY);
|
surroundMap.setCenter(centerX, centerY);
|
||||||
// 2 is safety padding preventing ChunksController rounding problem
|
// 3 is safety padding preventing ChunksController rounding problem
|
||||||
surroundMap.resize(loadDistance + 2);
|
// FIXME
|
||||||
|
surroundMap.resize(loadDistance + 3);
|
||||||
surroundMap.setCenter(centerX, centerY);
|
surroundMap.setCenter(centerX, centerY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user