use set/clear mod functions
This commit is contained in:
parent
0c2c90e786
commit
e0ae1b14fe
@ -63,7 +63,6 @@ namespace mods
|
|||||||
utils::nt::relaunch_self(mode.append(arg), true);
|
utils::nt::relaunch_self(mode.append(arg), true);
|
||||||
utils::nt::terminate();
|
utils::nt::terminate();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
bool mod_requires_restart(const std::string& path)
|
bool mod_requires_restart(const std::string& path)
|
||||||
{
|
{
|
||||||
@ -84,6 +83,7 @@ namespace mods
|
|||||||
game::DVAR_SOURCE_INTERNAL);
|
game::DVAR_SOURCE_INTERNAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void set_mod(const std::string& path)
|
void set_mod(const std::string& path)
|
||||||
{
|
{
|
||||||
|
@ -2,5 +2,7 @@
|
|||||||
|
|
||||||
namespace mods
|
namespace mods
|
||||||
{
|
{
|
||||||
|
void set_mod(const std::string& path);
|
||||||
|
void clear_mod();
|
||||||
std::optional<std::string> get_mod();
|
std::optional<std::string> get_mod();
|
||||||
}
|
}
|
@ -9,6 +9,7 @@
|
|||||||
#include "server_list.hpp"
|
#include "server_list.hpp"
|
||||||
#include "download.hpp"
|
#include "download.hpp"
|
||||||
#include "fastfiles.hpp"
|
#include "fastfiles.hpp"
|
||||||
|
#include "mods.hpp"
|
||||||
|
|
||||||
#include "game/game.hpp"
|
#include "game/game.hpp"
|
||||||
#include "game/ui_scripting/execution.hpp"
|
#include "game/ui_scripting/execution.hpp"
|
||||||
@ -263,8 +264,7 @@ namespace party
|
|||||||
|
|
||||||
if (server_fs_game.empty() && !client_fs_game.empty())
|
if (server_fs_game.empty() && !client_fs_game.empty())
|
||||||
{
|
{
|
||||||
game::Dvar_SetFromStringByNameFromSource("fs_game", "",
|
mods::clear_mod();
|
||||||
game::DVAR_SOURCE_INTERNAL);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -297,8 +297,7 @@ namespace party
|
|||||||
}
|
}
|
||||||
else if (client_fs_game != server_fs_game)
|
else if (client_fs_game != server_fs_game)
|
||||||
{
|
{
|
||||||
game::Dvar_SetFromStringByNameFromSource("fs_game", server_fs_game.data(),
|
mods::set_mod(server_fs_game);
|
||||||
game::DVAR_SOURCE_INTERNAL);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user