Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/wip5.8.0' into wip5.8.0webport
Browse files Browse the repository at this point in the history
  • Loading branch information
proller committed Nov 21, 2024
2 parents 4588f18 + f663144 commit 931233e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/client/fm_far_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ const MapNode &FarContainer::getNodeRefUnsafe(const v3pos_t &pos)
const auto step = getFarStep(m_client->getEnv().getClientMap().getControl(),
getNodeBlockPos(m_client->getEnv().getClientMap().far_blocks_last_cam_pos),
bpos);
const auto &shift = step; // + cell_size_pow;
//const auto &shift = step; // + cell_size_pow;
//const v3bpos_t bpos_aligned((bpos.X >> shift) << shift, (bpos.Y >> shift) << shift, (bpos.Z >> shift) << shift);
const v3bpos_t bpos_aligned = getFarActual(bpos,
getNodeBlockPos(m_client->getEnv().getClientMap().far_blocks_last_cam_pos),
step, m_client->getEnv().getClientMap().getControl());
Expand All @@ -38,7 +39,6 @@ const MapNode &FarContainer::getNodeRefUnsafe(const v3pos_t &pos)

if (!block && step < FARMESH_STEP_MAX) {
const auto &storage = m_client->getEnv().getClientMap().far_blocks_storage[step];

block = storage.get(bpos_aligned);
}

Expand Down Expand Up @@ -87,7 +87,7 @@ const MapNode &FarContainer::getNodeRefUnsafe(const v3pos_t &pos)
if (block) {
v3pos_t relpos = pos - bpos_aligned * MAP_BLOCKSIZE;

const auto &relpos_shift = step; // + 1;
const auto &relpos_shift = step;
const auto relpos_shifted = v3pos_t(relpos.X >> relpos_shift,
relpos.Y >> relpos_shift, relpos.Z >> relpos_shift);
const auto &n = block->getNodeNoLock(relpos_shifted);
Expand Down
3 changes: 2 additions & 1 deletion src/client/fm_farmesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ void FarMesh::makeFarBlock(const v3bpos_t &blockpos, block_step_t step, bool nea
block->far_iteration = far_iteration_complete;
return;
}

MapBlockP block;
{
const auto lock = far_blocks.lock_unique_rec();
Expand All @@ -103,7 +104,7 @@ void FarMesh::makeFarBlock(const v3bpos_t &blockpos, block_step_t step, bool nea
}
}
}

block->far_iteration = far_iteration_complete;

if (m_client->m_uptime >= block->far_make_mesh_timestamp) {
Expand Down
6 changes: 4 additions & 2 deletions src/fm_world_merge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,14 @@ void WorldMerger::merge_one_block(MapDatabase *dbase, MapDatabase *dbase_up,
for (pos_t y = 0; y < block_size; ++y)
for (pos_t z = 0; z < block_size; ++z) {
const v3pos_t npos(x, y, z);
const v3pos_t bbpos(x >> (4 - step_pow), y >> (4 - step_pow),
z >> (4 - step_pow));
const v3pos_t bbpos(x >> (MAP_BLOCKP - step_pow),
y >> (MAP_BLOCKP - step_pow), z >> (MAP_BLOCKP - step_pow));

const auto &block = blocks[bbpos];
if (!block) {
continue;
}

const v3pos_t lpos((x << step_pow) % MAP_BLOCKSIZE,
(y << step_pow) % MAP_BLOCKSIZE,
(z << step_pow) % MAP_BLOCKSIZE);
Expand Down Expand Up @@ -394,6 +395,7 @@ bool WorldMerger::add_changed(const v3bpos_t &bpos)
changed_blocks_for_merge.clear();
return true;
}

void WorldMerger::init()
{
m_map_compression_level =
Expand Down
2 changes: 2 additions & 0 deletions src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -868,9 +868,11 @@ size_t ServerMap::transformLiquids(std::map<v3bpos_t, MapBlock*> &modified_block
}

// Ignore light (because calling voxalgo::update_lighting_nodes)
/*
ContentLightingFlags f0 = m_nodedef->getLightingFlags(n0);
n0.setLight(LIGHTBANK_DAY, 0, f0);
n0.setLight(LIGHTBANK_NIGHT, 0, f0);
*/

// Find out whether there is a suspect for this action
std::string suspect;
Expand Down
2 changes: 1 addition & 1 deletion src/server/activeobjectmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ void ActiveObjectMgr::getAddedActiveObjectsAroundPos(const v3f &player_pos, f32
added_objects.push(id);


if (++count > 10)
if (++count > 10 && !current_objects.empty())
break;

}
Expand Down
6 changes: 2 additions & 4 deletions src/serverlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,8 @@ Json::Value MakeReport(AnnounceAction action,
server["damage"] = g_settings->getBool("enable_damage");
server["password"] = g_settings->getBool("disallow_empty_password");
server["pvp"] = g_settings->getBool("enable_pvp");
if (uptime >= 1)
server["uptime"] = (int) uptime;
if (game_time >= 1)
server["game_time"]= game_time;
server["uptime"] = (int) uptime;
server["game_time"]= game_time;
server["clients"] = (int) clients_names.size();
server["clients_max"] = g_settings->getU16("max_users");
server["clients_list"] = Json::Value(Json::arrayValue);
Expand Down

0 comments on commit 931233e

Please sign in to comment.