Skip to content

Commit ba09817

Browse files
authored
Fix: content-type of zero is also invalid (#26)
1 parent 6c14fa7 commit ba09817

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

openttd_protocol/protocol/content.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def receive_PACKET_CONTENT_CLIENT_INFO_LIST(source, data):
8787
version, data = read_string(data)
8888
branch_versions[branch] = version
8989

90-
if content_type >= ContentType.CONTENT_TYPE_END:
90+
if content_type == 0 or content_type >= ContentType.CONTENT_TYPE_END:
9191
raise PacketInvalidData("invalid ContentType", content_type)
9292

9393
content_type = ContentType(content_type)
@@ -109,7 +109,7 @@ def _receive_client_info(data, count, has_content_id=False, has_content_type_and
109109

110110
if has_content_type_and_unique_id:
111111
content_type, data = read_uint8(data)
112-
if content_type >= ContentType.CONTENT_TYPE_END:
112+
if content_type == 0 or content_type >= ContentType.CONTENT_TYPE_END:
113113
raise PacketInvalidData("invalid ContentType", content_type)
114114
content_type = ContentType(content_type)
115115
content_info["content_type"] = content_type

0 commit comments

Comments
 (0)