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