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.
This commit is contained in:
Mysteryem
2025-04-30 03:57:35 +01:00
committed by GitHub
parent 3ef35105c8
commit 5f974b7457

View File

@@ -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):