Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
migratesettings.h
Go to the documentation of this file.
1// Minetest
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#include "settings.h"
5#include "server.h"
6
8{
9 // Converts opaque_water to translucent_liquids
10 if (g_settings->existsLocal("opaque_water")) {
11 g_settings->set("translucent_liquids",
12 g_settings->getBool("opaque_water") ? "false" : "true");
13 g_settings->remove("opaque_water");
14 }
15
16 // Converts enable_touch to touch_controls/touch_gui
17 if (g_settings->existsLocal("enable_touch")) {
18 bool value = g_settings->getBool("enable_touch");
19 g_settings->setBool("touch_controls", value);
20 g_settings->setBool("touch_gui", value);
21 g_settings->remove("enable_touch");
22 }
23
24 // Disables anticheat
25 if (g_settings->existsLocal("disable_anticheat")) {
26 if (g_settings->getBool("disable_anticheat")) {
27 g_settings->setFlagStr("anticheat_flags", 0, flagdesc_anticheat);
28 }
29 g_settings->remove("disable_anticheat");
30 }
31}
bool remove(const std::string &name)
Definition settings.cpp:959
bool setBool(const std::string &name, bool value)
Definition settings.cpp:876
bool set(const std::string &name, const std::string &value)
Definition settings.cpp:847
bool getBool(const std::string &name) const
Definition settings.cpp:484
bool existsLocal(const std::string &name) const
Definition settings.cpp:653
bool setFlagStr(const std::string &name, u32 flags, const FlagDesc *flagdesc=nullptr, u32 flagmask=U32_MAX)
Definition settings.cpp:930
void migrate_settings()
Definition migratesettings.h:7
constexpr static const FlagDesc flagdesc_anticheat[]
Definition server.h:76
Settings * g_settings
Definition settings.cpp:22