3260: "Connect to" popup: Don't disconnect on enter (fixes #3259) r=Jupeyy a=def-

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [x] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: def <dennis@felsin9.de>
This commit is contained in:
bors[bot] 2020-11-07 00:56:46 +00:00 committed by GitHub
commit 612c592ef2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1605,7 +1605,7 @@ int CMenus::Render()
Part.VMargin(120.0f, &Part);
static int s_Button = 0;
if(DoButton_Menu(&s_Button, pButtonText, 0, &Part) || m_EscapePressed || m_EnterPressed)
if(DoButton_Menu(&s_Button, pButtonText, 0, &Part) || m_EscapePressed || (m_EnterPressed && m_Popup != POPUP_CONNECTING))
{
Client()->Disconnect();
m_Popup = POPUP_NONE;