OpenTTD/OpenTTD

[Bug]: Using disconnect button in main menu opens multiplayer lobby

Opened this issue · 3 comments

ldpl commented

Version of OpenTTD

master(bb9b8b9)

Expected result

Connection window is closed and game stays in the main menu like it dose in case of connection error.

Actual result

Game opens multiplayer lobby.

Steps to reproduce

  1. In the main menu open console and use connect command, for example connect citymania.org:3980
  2. Quickly press the disconnect button before connection is made.

I would not consider this a bug. The console is not meant for normal use, and sure, if you know your way around you can use it for shortcuts like that. But the game is designed around the GUIs, and from a code-flow perspective it makes most sense to open the multiplayer window when you disconnect from a server.

And yes, one can argue the same should happen on a connection error, and maybe we should.

Either way, fixing this "bug" is most likely more trouble than worth.

My 2 cents.

ldpl commented

Despite being named "Disconnect" it's logically a button to cancel connection attempt as you're not fully connected to the server yet. So it should bring you back where you started, not open some marginally related windows.

Also, fixing it may be as simple as just removing two lines.
So I guess question is why it even opening that window in the first place as it's should already be open if you're using GUI to connect. And connect command kicks you out of the active game anyway. It seems to be in the code since r1 so whatever reason was there may not even be relevant anymore, especially considering 05394d5

Also, fixing it may be as simple as just removing two lines.

If this is the case, a PR would be nice. 😄