introduce local player

This commit is contained in:
MihailRis
2025-01-16 05:59:43 +03:00
parent b5999fe364
commit 65fec4f4a9
16 changed files with 84 additions and 31 deletions
+4 -2
View File
@@ -92,7 +92,7 @@ bool ChunksController::loadVisible(const Player& player, uint padding) const {
}
const auto& chunk = chunks.getChunks()[nearZ * sizeX + nearX];
if (chunk != nullptr || !assigned) {
if (chunk != nullptr || !assigned || !player.isLoadingChunks()) {
return false;
}
int offsetX = chunks.getOffsetX();
@@ -101,7 +101,9 @@ bool ChunksController::loadVisible(const Player& player, uint padding) const {
return true;
}
bool ChunksController::buildLights(const Player& player, const std::shared_ptr<Chunk>& chunk) const {
bool ChunksController::buildLights(
const Player& player, const std::shared_ptr<Chunk>& chunk
) const {
int surrounding = 0;
for (int oz = -1; oz <= 1; oz++) {
for (int ox = -1; ox <= 1; ox++) {