Bugfix for parse_code
This commit is contained in:
parent
ec81ce75aa
commit
20b62a6caf
@ -104,17 +104,21 @@ async def parse_code(code, game):
|
|||||||
built = ""
|
built = ""
|
||||||
category = ""
|
category = ""
|
||||||
for c in code:
|
for c in code:
|
||||||
|
if len(built) < digits:
|
||||||
|
built += c
|
||||||
|
|
||||||
if built == "T" or built == "W" or built == "N":
|
if built == "T" or built == "W" or built == "N":
|
||||||
# Random Towns
|
# Random Towns
|
||||||
category = built
|
category = built
|
||||||
built = ""
|
built = ""
|
||||||
digits = 1
|
digits = 1
|
||||||
elif built == "-":
|
|
||||||
digits += 1
|
|
||||||
|
|
||||||
if len(built) < digits:
|
|
||||||
built += c
|
|
||||||
continue
|
continue
|
||||||
|
elif built == "-":
|
||||||
|
built = ""
|
||||||
|
digits += 1
|
||||||
|
continue
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
idx = int(built)
|
idx = int(built)
|
||||||
@ -138,6 +142,9 @@ async def parse_code(code, game):
|
|||||||
|
|
||||||
decode.append(choice(options)(game))
|
decode.append(choice(options)(game))
|
||||||
|
|
||||||
|
built = ""
|
||||||
|
|
||||||
|
|
||||||
return decode
|
return decode
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user