summaryrefslogtreecommitdiff
path: root/src/network/network_udp.cpp
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2020-05-17 23:31:47 +0200
committerMichael Lutz <michi@icosahedron.de>2020-05-21 20:02:34 +0200
commit43cd892e0c2c012355d7eb6d47cfa4ad4b7e68eb (patch)
tree589c8791baba745a7dfc3a33b19a28c8b0046ea8 /src/network/network_udp.cpp
parentf2b40f40aa7cbccaed20ec52b41d4704a45d8db1 (diff)
downloadopenttd-43cd892e0c2c012355d7eb6d47cfa4ad4b7e68eb.tar.xz
Codechange: Replace custom linked list for GRF texts with STL vectors and strings.
Diffstat (limited to 'src/network/network_udp.cpp')
-rw-r--r--src/network/network_udp.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp
index 90b99ec44..03344fe57 100644
--- a/src/network/network_udp.cpp
+++ b/src/network/network_udp.cpp
@@ -426,9 +426,9 @@ void ClientNetworkUDPSocketHandler::Receive_SERVER_NEWGRFS(Packet *p, NetworkAdd
/* Try to find the GRFTextWrapper for the name of this GRF ID and MD5sum tuple.
* If it exists and not resolved yet, then name of the fake GRF is
* overwritten with the name from the reply. */
- GRFTextWrapper *unknown_name = FindUnknownGRFName(c.grfid, c.md5sum, false);
- if (unknown_name != nullptr && strcmp(GetGRFStringFromGRFText(unknown_name->text), UNKNOWN_GRF_NAME_PLACEHOLDER) == 0) {
- AddGRFTextToList(&unknown_name->text, name);
+ GRFTextWrapper unknown_name = FindUnknownGRFName(c.grfid, c.md5sum, false);
+ if (unknown_name && strcmp(GetGRFStringFromGRFText(unknown_name), UNKNOWN_GRF_NAME_PLACEHOLDER) == 0) {
+ AddGRFTextToList(unknown_name, name);
}
}
}
@@ -441,21 +441,13 @@ void ClientNetworkUDPSocketHandler::HandleIncomingNetworkGameInfoGRFConfig(GRFCo
/* Don't know the GRF, so mark game incompatible and the (possibly)
* already resolved name for this GRF (another server has sent the
* name of the GRF already */
- config->name->Release();
config->name = FindUnknownGRFName(config->ident.grfid, config->ident.md5sum, true);
- config->name->AddRef();
config->status = GCS_NOT_FOUND;
} else {
config->filename = f->filename;
- config->name->Release();
config->name = f->name;
- config->name->AddRef();
- config->info->Release();
config->info = f->info;
- config->info->AddRef();
- config->url->Release();
config->url = f->url;
- config->url->AddRef();
}
SetBit(config->flags, GCF_COPY);
}