Skip to content

Commit a83bf2f

Browse files
authored
LADX: Fix bug with Webhost usage (#2556)
We were using data created in init when we never called init
1 parent e8ceb12 commit a83bf2f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

worlds/ladx/Options.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -349,18 +349,19 @@ class GfxMod(FreeText, LADXROption):
349349
normal = ''
350350
default = 'Link'
351351

352+
__spriteDir: str = Utils.local_path(os.path.join('data', 'sprites','ladx'))
352353
__spriteFiles: typing.DefaultDict[str, typing.List[str]] = defaultdict(list)
353-
__spriteDir: str = None
354354

355355
extensions = [".bin", ".bdiff", ".png", ".bmp"]
356+
357+
for file in os.listdir(__spriteDir):
358+
name, extension = os.path.splitext(file)
359+
if extension in extensions:
360+
__spriteFiles[name].append(file)
361+
356362
def __init__(self, value: str):
357363
super().__init__(value)
358-
if not GfxMod.__spriteDir:
359-
GfxMod.__spriteDir = Utils.local_path(os.path.join('data', 'sprites','ladx'))
360-
for file in os.listdir(GfxMod.__spriteDir):
361-
name, extension = os.path.splitext(file)
362-
if extension in self.extensions:
363-
GfxMod.__spriteFiles[name].append(file)
364+
364365

365366
def verify(self, world, player_name: str, plando_options) -> None:
366367
if self.value == "Link" or self.value in GfxMod.__spriteFiles:

0 commit comments

Comments
 (0)