From: PilzAdam Date: Mon, 7 Jan 2013 17:18:16 +0000 (+0100) Subject: Add a setting to enable always flying fast X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=0437abbffbcff46e33de14c0baedc676f14e7507;p=zefram%2Fminetest%2Fminetest_engine.git Add a setting to enable always flying fast --- diff --git a/minetest.conf.example b/minetest.conf.example index 5bb75bde..3f3256a0 100644 --- a/minetest.conf.example +++ b/minetest.conf.example @@ -53,6 +53,8 @@ #aux1_descends = false # Doubletaping the jump key toogles fly mode #doubletap_jump = false +# If false aux1 is used to fly fast +#always_fly_fast = true # Some (temporary) keys for debugging #keymap_print_debug_stacks = KEY_KEY_P #keymap_quicktune_prev = KEY_HOME diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 75fea84c..9ada214a 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -57,6 +57,7 @@ void set_default_settings(Settings *settings) settings->setDefault("anaglyph_strength", "0.1"); settings->setDefault("aux1_descends", "false"); settings->setDefault("doubletap_jump", "false"); + settings->setDefault("always_fly_fast", "true"); // Some (temporary) keys for debugging settings->setDefault("keymap_print_debug_stacks", "KEY_KEY_P"); diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 75147821..b6dd0f42 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -399,6 +399,9 @@ void LocalPlayer::applyControl(float dtime) // Whether superspeed mode is used or not bool superspeed = false; + if(g_settings->getBool("always_fly_fast") && free_move && fast_move) + superspeed = true; + // Old descend control if(g_settings->getBool("aux1_descends")) { @@ -454,7 +457,8 @@ void LocalPlayer::applyControl(float dtime) { // In free movement mode, sneak descends v3f speed = getSpeed(); - if(fast_move && control.aux1) + if(fast_move && (control.aux1 || + g_settings->getBool("always_fly_fast"))) speed.Y = -20*BS; else speed.Y = -walkspeed_max; @@ -497,7 +501,8 @@ void LocalPlayer::applyControl(float dtime) { v3f speed = getSpeed(); - if(g_settings->getBool("aux1_descends")) + if(g_settings->getBool("aux1_descends") || + g_settings->getBool("always_fly_fast")) { if(fast_move) speed.Y = 20*BS;