From 5f974b7457efe4e8aa7f1734e7a83b00a1fdc1b1 Mon Sep 17 00:00:00 2001 From: Mysteryem Date: Wed, 30 Apr 2025 03:57:35 +0100 Subject: [PATCH] SM: Fix FakeROM instances sharing the same data dictionary (#4912) FakeROM instances were being created with default arguments, which included a mutable default argument data dictionary, so all FakeROM instances would be writing to and reading the same dictionary, resulting in broken patch data in multiworlds with more than one Super Metroid world. --- worlds/sm/variaRandomizer/rom/rom.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/worlds/sm/variaRandomizer/rom/rom.py b/worlds/sm/variaRandomizer/rom/rom.py index f0f37b76..05218ff5 100644 --- a/worlds/sm/variaRandomizer/rom/rom.py +++ b/worlds/sm/variaRandomizer/rom/rom.py @@ -89,9 +89,12 @@ class ROM(object): class FakeROM(ROM): # to have the same code for real ROM and the webservice - def __init__(self, data={}): + def __init__(self, data=None): super(FakeROM, self).__init__() - self.data = data + if data is None: + self.data = {} + else: + self.data = data self.ipsPatches = [] def write(self, bytes):