summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorplanetmaker <planetmaker@openttd.org>2011-10-07 08:17:47 +0000
committerplanetmaker <planetmaker@openttd.org>2011-10-07 08:17:47 +0000
commit74f6813a55f0f9183ad6a6740028fd3f1b58d647 (patch)
tree55cf13f7df89f5157a3e0f31b0046cf030edfad3 /src
parent765588f699dfd5c14b812ac97829305b5831b125 (diff)
downloadopenttd-74f6813a55f0f9183ad6a6740028fd3f1b58d647.tar.xz
(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)
Diffstat (limited to 'src')
-rw-r--r--src/network/network_gui.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp
index 781110261..de8fadae1 100644
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -716,9 +716,8 @@ public:
}
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 @@ public:
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;
}