]> git.lizzy.rs Git - minetest.git/blobdiff - src/client.cpp
Biome API: Enable biome generation to lower world limit
[minetest.git] / src / client.cpp
index 780b07872d4d90a9cc6dbadf0d9f3d5fdba2e169..de813187574ddba26ca117e42467d074e98f37dc 100644 (file)
@@ -1102,7 +1102,7 @@ void Client::sendRemovedSounds(std::vector<s32> &soundList)
 }
 
 void Client::sendNodemetaFields(v3s16 p, const std::string &formname,
-               const std::map<std::string, std::string> &fields)
+               const StringMap &fields)
 {
        size_t fields_size = fields.size();
 
@@ -1112,10 +1112,10 @@ void Client::sendNodemetaFields(v3s16 p, const std::string &formname,
 
        pkt << p << formname << (u16) (fields_size & 0xFFFF);
 
-       for(std::map<std::string, std::string>::const_iterator
-                       i = fields.begin(); i != fields.end(); i++) {
-               const std::string &name = i->first;
-               const std::string &value = i->second;
+       StringMap::const_iterator it;
+       for (it = fields.begin(); it != fields.end(); ++it) {
+               const std::string &name = it->first;
+               const std::string &value = it->second;
                pkt << name;
                pkt.putLongString(value);
        }
@@ -1124,7 +1124,7 @@ void Client::sendNodemetaFields(v3s16 p, const std::string &formname,
 }
 
 void Client::sendInventoryFields(const std::string &formname,
-               const std::map<std::string, std::string> &fields)
+               const StringMap &fields)
 {
        size_t fields_size = fields.size();
        FATAL_ERROR_IF(fields_size > 0xFFFF, "Unsupported number of inventory fields");
@@ -1132,10 +1132,10 @@ void Client::sendInventoryFields(const std::string &formname,
        NetworkPacket pkt(TOSERVER_INVENTORY_FIELDS, 0);
        pkt << formname << (u16) (fields_size & 0xFFFF);
 
-       for(std::map<std::string, std::string>::const_iterator
-                       i = fields.begin(); i != fields.end(); i++) {
-               const std::string &name  = i->first;
-               const std::string &value = i->second;
+       StringMap::const_iterator it;
+       for (it = fields.begin(); it != fields.end(); ++it) {
+               const std::string &name  = it->first;
+               const std::string &value = it->second;
                pkt << name;
                pkt.putLongString(value);
        }
@@ -1741,6 +1741,9 @@ void Client::afterContentReceived(IrrlichtDevice *device)
        text = wgettext("Initializing nodes...");
        draw_load_screen(text, device, guienv, 0, 72);
        m_nodedef->updateAliases(m_itemdef);
+       std::string texture_path = g_settings->get("texture_path");
+       if (texture_path != "" && fs::IsDir(texture_path))
+               m_nodedef->applyTextureOverrides(texture_path + DIR_DELIM + "override.txt");
        m_nodedef->setNodeRegistrationStatus(true);
        m_nodedef->runNodeResolveCallbacks();
        delete[] text;
@@ -1915,14 +1918,13 @@ ParticleManager* Client::getParticleManager()
 
 scene::IAnimatedMesh* Client::getMesh(const std::string &filename)
 {
-       std::map<std::string, std::string>::const_iterator i =
-                       m_mesh_data.find(filename);
-       if(i == m_mesh_data.end()){
-               errorstream<<"Client::getMesh(): Mesh not found: \""<<filename<<"\""
-                               <<std::endl;
+       StringMap::const_iterator it = m_mesh_data.find(filename);
+       if (it == m_mesh_data.end()) {
+               errorstream << "Client::getMesh(): Mesh not found: \"" << filename
+                       << "\"" << std::endl;
                return NULL;
        }
-       const std::string &data    = i->second;
+       const std::string &data    = it->second;
        scene::ISceneManager *smgr = m_device->getSceneManager();
 
        // Create the mesh, remove it from cache and return it