mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2025-07-01 23:46:59 +00:00
fix mod name bug
This commit is contained in:
parent
8b0f4f99f6
commit
d32da036bc
@ -296,13 +296,14 @@ void SyncResources(SOCKET Sock) {
|
|||||||
if (!fs::exists(GetGamePath() + "mods/multiplayer")) {
|
if (!fs::exists(GetGamePath() + "mods/multiplayer")) {
|
||||||
fs::create_directories(GetGamePath() + "mods/multiplayer");
|
fs::create_directories(GetGamePath() + "mods/multiplayer");
|
||||||
}
|
}
|
||||||
auto name = GetGamePath() + "mods/multiplayer" + a.substr(a.find_last_of('/'));
|
auto modname = a.substr(a.find_last_of('/'));
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
// Linux version of the game doesnt support uppercase letters in mod names
|
// Linux version of the game doesnt support uppercase letters in mod names
|
||||||
for (char& c : name) {
|
for (char& c : modname) {
|
||||||
c = ::tolower(c);
|
c = ::tolower(c);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
auto name = GetGamePath() + "mods/multiplayer" + modname;
|
||||||
auto tmp_name = name + ".tmp";
|
auto tmp_name = name + ".tmp";
|
||||||
fs::copy_file(a, tmp_name, fs::copy_options::overwrite_existing);
|
fs::copy_file(a, tmp_name, fs::copy_options::overwrite_existing);
|
||||||
fs::rename(tmp_name, name);
|
fs::rename(tmp_name, name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user