mirror of https://github.com/OpenTTD/OpenTTD
(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)
parent
765588f699
commit
74f6813a55
|
@ -716,9 +716,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
case NGWW_LASTJOINED: {
|
case NGWW_LASTJOINED: {
|
||||||
NetworkGameList *last_joined = NetworkGameListAddItem(NetworkAddress(_settings_client.network.last_host, _settings_client.network.last_port));
|
if (this->last_joined != NULL) {
|
||||||
if (last_joined != NULL) {
|
this->server = this->last_joined;
|
||||||
this->server = last_joined;
|
|
||||||
|
|
||||||
/* search the position of the newly selected server */
|
/* search the position of the newly selected server */
|
||||||
for (uint i = 0; i < this->servers.Length(); i++) {
|
for (uint i = 0; i < this->servers.Length(); i++) {
|
||||||
|
@ -861,6 +860,7 @@ public:
|
||||||
if (this->server != NULL) {
|
if (this->server != NULL) {
|
||||||
if (keycode == WKC_DELETE) { // Press 'delete' to remove servers
|
if (keycode == WKC_DELETE) { // Press 'delete' to remove servers
|
||||||
NetworkGameListRemoveItem(this->server);
|
NetworkGameListRemoveItem(this->server);
|
||||||
|
if (this->server == this->last_joined) this->last_joined = NULL;
|
||||||
this->server = NULL;
|
this->server = NULL;
|
||||||
this->list_pos = SLP_INVALID;
|
this->list_pos = SLP_INVALID;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue