Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
proller committed Oct 18, 2024
1 parent 32cd892 commit 16f7118
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/client/fm_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ void Client::handleCommand_FreeminerInit(NetworkPacket *pkt)
{
Settings settings;
packet[TOCLIENT_INIT_MAP_PARAMS].convert(settings);

std::string mg_name;
MapgenType mgtype = settings.getNoEx("mg_name", mg_name)
? Mapgen::getMapgenType(mg_name)
Expand All @@ -110,6 +109,8 @@ void Client::handleCommand_FreeminerInit(NetworkPacket *pkt)
<< Mapgen::getMapgenName(FARMESH_DEFAULT_MAPGEN) << std::endl;
mgtype = FARMESH_DEFAULT_MAPGEN;
far_container.use_weather = false;
} else {
far_container.have_params = true;
}

MakeEmerge(settings, mgtype);
Expand Down Expand Up @@ -234,7 +235,7 @@ void Client::handleCommand_BlockDataFm(NetworkPacket *pkt)
if (const auto db = GetFarDatabase({}, far_dbases, m_world_path, step); db) {
ServerMap::saveBlock(block.get(), db);

if (!step) {
if (!step && !far_container.have_params) {
merger->add_changed(bpos);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/client/fm_far_container.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class FarContainer : public NodeContainer
public:
Mapgen *m_mg{};
bool use_weather {true};
bool have_params {};
FarContainer(Client *client);
const MapNode &getNodeRefUnsafe(const v3pos_t &p) override;
};
4 changes: 3 additions & 1 deletion src/network/clientpackethandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,9 @@ void Client::handleCommand_BlockData(NetworkPacket* pkt)

if (m_localdb && !is_simple_singleplayer_game) {
ServerMap::saveBlock(block, m_localdb);
merger->add_changed(p);
if (!far_container.have_params) {
merger->add_changed(p);
}
}

/*
Expand Down

0 comments on commit 16f7118

Please sign in to comment.