Skip to content

Commit 98af37b

Browse files
Update gamespy1.py
1 parent 500f3dd commit 98af37b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

opengsq/protocols/gamespy1.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,14 @@ def __parse_as_key_values(self, br: BinaryReader, is_status=False):
120120
while br.length() > 0:
121121
key = br.read_string(b'\\').lower()
122122

123-
if is_status and (items := key.split('_')) and len(items) > 1 and items[1].isdigit():
124-
# Read already, so add it back
125-
br.prepend_bytes(key.encode() + b'\\')
126-
break
123+
# Check is the end of key_values
124+
if is_status:
125+
items = key.split('_')
126+
127+
if len(items) > 1 and items[1].isdigit():
128+
# Read already, so add it back
129+
br.prepend_bytes(key.encode() + b'\\')
130+
break
127131

128132
value = br.read_string(b'\\')
129133
kv[key] = value.strip()

0 commit comments

Comments
 (0)