Fix error messages beeing shown on pressing cursor keys in various menus
authorsapier <Sapier at GMX dot net>
Sun, 11 May 2014 00:57:47 +0000 (02:57 +0200)
committersapier <Sapier at GMX dot net>
Sun, 11 May 2014 00:57:47 +0000 (02:57 +0200)
src/game.cpp

index 8a0aa177603cef2809e1e4d148d06b70d091c976..0b28c7d176fdd3adbdfa2b669ee38e6ea6402213 100644 (file)
@@ -193,6 +193,14 @@ struct LocalFormspecHandler : public TextDest
                        }
                }
 
+               // don't show error message for unhandled cursor keys
+               if ( (fields.find("key_up") != fields.end()) ||
+                       (fields.find("key_down") != fields.end()) ||
+                       (fields.find("key_left") != fields.end()) ||
+                       (fields.find("key_right") != fields.end())) {
+                       return;
+               }
+
                errorstream << "LocalFormspecHandler::gotText unhandled >" << m_formname << "< event" << std::endl;
                int i = 0;
                for (std::map<std::string,std::string>::iterator iter = fields.begin();