]> git.lizzy.rs Git - minetest.git/blobdiff - src/guiMainMenu.cpp
Fix possible NULL pointer access in MobV2CAO
[minetest.git] / src / guiMainMenu.cpp
index 2d5bd151acadd87fcb84f0f436e076fb2a1f90b1..cf9b8eda42f658bf6e071d63d088d092a2e08efd 100644 (file)
@@ -22,7 +22,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "debug.h"
 #include "serialization.h"
 #include <string>
-
+#include <IGUICheckBox.h>
+#include <IGUIEditBox.h>
+#include <IGUIButton.h>
+#include <IGUIStaticText.h>
+#include <IGUIFont.h>
 
 
 #include "gettext.h"
@@ -196,6 +200,8 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
                gui::IGUIEditBox *e =
                Environment->addEditBox(L"", rect, true, this, 264);
                e->setPasswordBox(true);
+               if(text_name != L"" && text_address != L"")
+                       Environment->setFocus(e);
 
        }
        changeCtype("");
@@ -212,7 +218,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
                rect += topleft_client + v2s32(160, 100);
                gui::IGUIElement *e = 
                Environment->addEditBox(text_address.c_str(), rect, true, this, GUI_ID_ADDRESS_INPUT);
-               if(text_name != L"")
+               if(text_name != L"" && text_address == L"")
                        Environment->setFocus(e);
        }
        {