Place block when holding sneak while right-clicking nodes with formspec
authorJeija <norrepli@gmail.com>
Sat, 26 Jan 2013 22:15:23 +0000 (23:15 +0100)
committerIlya Zhuravlev <zhuravlevilya@ya.ru>
Sun, 27 Jan 2013 20:44:42 +0000 (00:44 +0400)
src/game.cpp

index 588a0fef34cd1dbc43094b754d4b0a8807914dcc..e923cbbb014a8b409aa83e891cd8380199e574aa 100644 (file)
@@ -2482,7 +2482,9 @@ void the_game(
                                
                                // Sign special case, at least until formspec is properly implemented.
                                // Deprecated?
-                               if(meta && meta->getString("formspec") == "hack:sign_text_input" && !random_input)
+                               if(meta && meta->getString("formspec") == "hack:sign_text_input" 
+                                               && !random_input
+                                               && !input->isKeyDown(getKeySetting("keymap_sneak")))
                                {
                                        infostream<<"Launching metadata text input"<<std::endl;
                                        
@@ -2497,7 +2499,8 @@ void the_game(
                                                        wtext))->drop();
                                }
                                // If metadata provides an inventory view, activate it
-                               else if(meta && meta->getString("formspec") != "" && !random_input)
+                               else if(meta && meta->getString("formspec") != "" && !random_input
+                                               && !input->isKeyDown(getKeySetting("keymap_sneak")))
                                {
                                        infostream<<"Launching custom inventory view"<<std::endl;