Add a setting to enable always flying fast
authorPilzAdam <PilzAdam@gmx.de>
Mon, 7 Jan 2013 17:18:16 +0000 (18:18 +0100)
committerPilzAdam <PilzAdam@gmx.de>
Mon, 7 Jan 2013 17:26:34 +0000 (18:26 +0100)
minetest.conf.example
src/defaultsettings.cpp
src/localplayer.cpp

index 5bb75bde4bdeebe104df5d20363ff3b114cebabe..3f3256a0466097ed070abf75b35866c4e99c1da6 100644 (file)
@@ -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
index 75fea84c80d2a23a4a8dc23afb6548ad6095ca5f..9ada214ae96b44d493c7c35e88a0b5c1ae58860e 100644 (file)
@@ -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");
index 751478213e13f0eb59f6d82440d1f6efc45bf5ac..b6dd0f42e22ace39b6649679acd5dc627517383f 100644 (file)
@@ -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;