aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars Hofhansl <larsh@apache.org>2016-10-16 23:55:49 -0700
committerNer'zhul <nerzhul@users.noreply.github.com>2016-10-17 20:26:48 +0200
commita291cd61320c2d041d64ed2d56d073d70066efd1 (patch)
tree0dd643834bc5e7d4bf68cc3bd7202bb61d4ea8db /src
parent3253b6bd2238eaa8f773f7881f8e47200dc5f42a (diff)
downloadminetest-a291cd61320c2d041d64ed2d56d073d70066efd1.tar.gz
minetest-a291cd61320c2d041d64ed2d56d073d70066efd1.tar.bz2
minetest-a291cd61320c2d041d64ed2d56d073d70066efd1.zip
Revert changes to toggleNoClip and toggleFreeMove
Diffstat (limited to 'src')
-rw-r--r--src/game.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 83ef9c0b0..3ba600ed5 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -1845,6 +1845,10 @@ Game::~Game()
&settingChangedCallback, this);
g_settings->deregisterChangedCallback("repeat_rightclick_time",
&settingChangedCallback, this);
+ g_settings->deregisterChangedCallback("noclip",
+ &settingChangedCallback, this);
+ g_settings->deregisterChangedCallback("free_move",
+ &settingChangedCallback, this);
}
bool Game::startup(bool *kill,
@@ -2965,14 +2969,12 @@ void Game::toggleFreeMove(float *statustext_time)
static const wchar_t *msg[] = { L"free_move disabled", L"free_move enabled" };
bool free_move = !g_settings->getBool("free_move");
+ g_settings->set("free_move", bool_to_cstr(free_move));
*statustext_time = 0;
statustext = msg[free_move];
- if (free_move && !client->checkPrivilege("fly")) {
+ if (free_move && !client->checkPrivilege("fly"))
statustext += L" (note: no 'fly' privilege)";
- } else {
- g_settings->set("free_move", bool_to_cstr(free_move));
- }
}
@@ -3007,15 +3009,13 @@ void Game::toggleNoClip(float *statustext_time)
{
static const wchar_t *msg[] = { L"noclip disabled", L"noclip enabled" };
bool noclip = !g_settings->getBool("noclip");
+ g_settings->set("noclip", bool_to_cstr(noclip));
*statustext_time = 0;
statustext = msg[noclip];
- if (noclip && !client->checkPrivilege("noclip")) {
+ if (noclip && !client->checkPrivilege("noclip"))
statustext += L" (note: no 'noclip' privilege)";
- } else {
- g_settings->set("noclip", bool_to_cstr(noclip));
- }
}
void Game::toggleCinematic(float *statustext_time)