diff options
author | rubidium42 <rubidium@openttd.org> | 2021-05-30 12:47:50 +0200 |
---|---|---|
committer | rubidium42 <rubidium42@users.noreply.github.com> | 2021-06-10 20:09:44 +0200 |
commit | 9c424ab741218238205e8d1f2644a3912fda250a (patch) | |
tree | 3aa21fe1a71c5d7ed3ec69259b72aa40e1358b30 /src/network/network_content.cpp | |
parent | dfb89f3891ec73b4d5a6f46092ad825dabec6bb7 (diff) | |
download | openttd-9c424ab741218238205e8d1f2644a3912fda250a.tar.xz |
Codechange: [ContentInfo] Use StringList for tags instead of custom allocations
Diffstat (limited to 'src/network/network_content.cpp')
-rw-r--r-- | src/network/network_content.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp index f78a839b8..27ffee970 100644 --- a/src/network/network_content.cpp +++ b/src/network/network_content.cpp @@ -70,9 +70,9 @@ bool ClientNetworkContentSocketHandler::Receive_SERVER_INFO(Packet *p) ci->dependencies = MallocT<ContentID>(ci->dependency_count); for (uint i = 0; i < ci->dependency_count; i++) ci->dependencies[i] = (ContentID)p->Recv_uint32(); - ci->tag_count = p->Recv_uint8(); - ci->tags = MallocT<char[32]>(ci->tag_count); - for (uint i = 0; i < ci->tag_count; i++) p->Recv_string(ci->tags[i], lengthof(*ci->tags)); + uint tag_count = p->Recv_uint8(); + ci->tags.reserve(tag_count); + for (uint i = 0; i < tag_count; i++) ci->tags.push_back(p->Recv_string(NETWORK_CONTENT_TAG_LENGTH)); if (!ci->IsValid()) { delete ci; |