Mercurial > hg > openttd
changeset 18182:b026c7a1cf1e draft
(svn r23011) -Fix [FS#4791]: When the last used server is deleted from the list also clear the last used server if it is the same (monoid)
author | planetmaker <planetmaker@openttd.org> |
---|---|
date | Fri, 07 Oct 2011 08:17:47 +0000 |
parents | 34951e23fc30 |
children | 2ab2a0b9ab00 |
files | src/network/network_gui.cpp |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -716,9 +716,8 @@ } case NGWW_LASTJOINED: { - NetworkGameList *last_joined = NetworkGameListAddItem(NetworkAddress(_settings_client.network.last_host, _settings_client.network.last_port)); - if (last_joined != NULL) { - this->server = last_joined; + if (this->last_joined != NULL) { + this->server = this->last_joined; /* search the position of the newly selected server */ for (uint i = 0; i < this->servers.Length(); i++) { @@ -861,6 +860,7 @@ if (this->server != NULL) { if (keycode == WKC_DELETE) { // Press 'delete' to remove servers NetworkGameListRemoveItem(this->server); + if (this->server == this->last_joined) this->last_joined = NULL; this->server = NULL; this->list_pos = SLP_INVALID; }