mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix "upgrade square is not fully inside of area" error
This commit is contained in:
parent
8a21bd212c
commit
bf79f6bc75
2 changed files with 7 additions and 4 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue