Skip to content

Commit

Permalink
APProcedurePatch: fix RLE/COPY incorrect sizing (ArchipelagoMW#3006)
Browse files Browse the repository at this point in the history
* change class variables to instance variables

* Update worlds/Files.py

Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>

* Update worlds/Files.py

Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>

* move required_extensions to tuple

* fix missing tuple ellipsis

* fix classvar mixup

* rename tokens to _tokens. use hasattr

* type hint cleanup

* Update Files.py

* check using isinstance instead

* Update Files.py

---------

Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
  • Loading branch information
Silvris and black-sliver authored Mar 22, 2024
1 parent 4196bde commit 218cd45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion worlds/Files.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def get_token_binary(self) -> bytes:
data.append(args)
elif token_type in [APTokenTypes.COPY, APTokenTypes.RLE]:
assert isinstance(args, tuple), f"Arguments to COPY/RLE must be of type tuple, not {type(args)}"
data.extend(int.to_bytes(4, 4, "little"))
data.extend(int.to_bytes(8, 4, "little"))
data.extend(args[0].to_bytes(4, "little"))
data.extend(args[1].to_bytes(4, "little"))
elif token_type == APTokenTypes.WRITE:
Expand Down

0 comments on commit 218cd45

Please sign in to comment.