mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Clean up server-side translations, remove global variable (#10075)
This commit is contained in:
parent
c8303f790c
commit
9ec75d7765
9 changed files with 50 additions and 65 deletions
|
@ -238,18 +238,13 @@ void Client::scanModSubfolder(const std::string &mod_name, const std::string &mo
|
|||
infostream << "Client::scanModSubfolder(): Loading \"" << real_path
|
||||
<< "\" as \"" << vfs_path << "\"." << std::endl;
|
||||
|
||||
std::ifstream is(real_path, std::ios::binary | std::ios::ate);
|
||||
if(!is.good()) {
|
||||
std::string contents;
|
||||
if (!fs::ReadFile(real_path, contents)) {
|
||||
errorstream << "Client::scanModSubfolder(): Can't read file \""
|
||||
<< real_path << "\"." << std::endl;
|
||||
continue;
|
||||
}
|
||||
auto size = is.tellg();
|
||||
std::string contents(size, '\0');
|
||||
is.seekg(0);
|
||||
is.read(&contents[0], size);
|
||||
|
||||
infostream << " size: " << size << " bytes" << std::endl;
|
||||
m_mod_vfs.emplace(vfs_path, contents);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue