APProcedurePatch: fix RLE/COPY incorrect sizing (#3006)

* 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>
This commit is contained in:
Silvris 2024-03-22 03:02:38 -05:00 committed by GitHub
parent 4196bde597
commit 218cd45844
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -322,7 +322,7 @@ class APTokenMixin:
data.append(args) data.append(args)
elif token_type in [APTokenTypes.COPY, APTokenTypes.RLE]: 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)}" 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[0].to_bytes(4, "little"))
data.extend(args[1].to_bytes(4, "little")) data.extend(args[1].to_bytes(4, "little"))
elif token_type == APTokenTypes.WRITE: elif token_type == APTokenTypes.WRITE: