From 25e5e68a9d41eff9b34eb0bb2111b9e5e5829492 Mon Sep 17 00:00:00 2001 From: Silvris <58583688+Silvris@users.noreply.github.com> Date: Tue, 19 Mar 2024 18:18:59 -0500 Subject: [PATCH] change class variables to instance variables --- worlds/Files.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/worlds/Files.py b/worlds/Files.py index 6fee582c87..380290412f 100644 --- a/worlds/Files.py +++ b/worlds/Files.py @@ -191,7 +191,7 @@ class APProcedurePatch(APAutoPatchInterface): hash: Optional[str] # base checksum of source file source_data: bytes patch_file_ending: str = "" - files: Dict[str, bytes] = {} + files: Dict[str, bytes] @classmethod def get_source_data(cls) -> bytes: @@ -206,6 +206,7 @@ class APProcedurePatch(APAutoPatchInterface): def __init__(self, *args: Any, **kwargs: Any): super(APProcedurePatch, self).__init__(*args, **kwargs) + self.files = dict() def get_manifest(self) -> Dict[str, Any]: manifest = super(APProcedurePatch, self).get_manifest() @@ -301,7 +302,7 @@ class APTokenMixin: bytes, # WRITE Tuple[int, int], # COPY, RLE int # AND_8, OR_8, XOR_8 - ]]] = [] + ]]] def get_token_binary(self) -> bytes: """ @@ -355,6 +356,8 @@ class APTokenMixin: """ Stores a token to be used by patching. """ + if not getattr(self, "tokens", None): + self.tokens = list() self.tokens.append((token_type, offset, data))