Sm broken start location fix (#841)
* - fixed basepatches application order breaking (at least) starting location
This commit is contained in:
parent
07450bb83d
commit
afc9c772be
|
@ -271,7 +271,7 @@ class SMWorld(World):
|
||||||
data.append(w1)
|
data.append(w1)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def APPatchRom(self, romPatcher):
|
def APPrePatchRom(self, romPatcher):
|
||||||
# first apply the sm multiworld code patch named 'basepatch' (also has empty tables that we'll overwrite),
|
# first apply the sm multiworld code patch named 'basepatch' (also has empty tables that we'll overwrite),
|
||||||
# + apply some patches from varia that we want to be always-on.
|
# + apply some patches from varia that we want to be always-on.
|
||||||
# basepatch and variapatches are both generated from https://github.com/lordlou/SMBasepatch
|
# basepatch and variapatches are both generated from https://github.com/lordlou/SMBasepatch
|
||||||
|
@ -279,6 +279,8 @@ class SMWorld(World):
|
||||||
"data", "SMBasepatch_prebuilt", "multiworld-basepatch.ips"))
|
"data", "SMBasepatch_prebuilt", "multiworld-basepatch.ips"))
|
||||||
romPatcher.applyIPSPatch(os.path.join(os.path.dirname(__file__),
|
romPatcher.applyIPSPatch(os.path.join(os.path.dirname(__file__),
|
||||||
"data", "SMBasepatch_prebuilt", "variapatches.ips"))
|
"data", "SMBasepatch_prebuilt", "variapatches.ips"))
|
||||||
|
|
||||||
|
def APPostPatchRom(self, romPatcher):
|
||||||
symbols = get_sm_symbols(os.path.join(os.path.dirname(__file__),
|
symbols = get_sm_symbols(os.path.join(os.path.dirname(__file__),
|
||||||
"data", "SMBasepatch_prebuilt", "sm-basepatch-symbols.json"))
|
"data", "SMBasepatch_prebuilt", "sm-basepatch-symbols.json"))
|
||||||
multiWorldLocations = []
|
multiWorldLocations = []
|
||||||
|
@ -504,7 +506,7 @@ class SMWorld(World):
|
||||||
outputFilename = os.path.join(output_directory, f'{outfilebase}{outfilepname}.sfc')
|
outputFilename = os.path.join(output_directory, f'{outfilebase}{outfilepname}.sfc')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.variaRando.PatchRom(outputFilename, self.APPatchRom)
|
self.variaRando.PatchRom(outputFilename, self.APPrePatchRom, self.APPostPatchRom)
|
||||||
self.write_crc(outputFilename)
|
self.write_crc(outputFilename)
|
||||||
self.rom_name = self.romName
|
self.rom_name = self.romName
|
||||||
except:
|
except:
|
||||||
|
|
|
@ -697,7 +697,7 @@ class VariaRandomizer:
|
||||||
#if args.patchOnly == False:
|
#if args.patchOnly == False:
|
||||||
# randoExec.postProcessItemLocs(itemLocs, args.hideItems)
|
# randoExec.postProcessItemLocs(itemLocs, args.hideItems)
|
||||||
|
|
||||||
def PatchRom(self, outputFilename, customPatchApply = None):
|
def PatchRom(self, outputFilename, customPrePatchApply = None, customPostPatchApply = None):
|
||||||
args = self.args
|
args = self.args
|
||||||
optErrMsgs = self.optErrMsgs
|
optErrMsgs = self.optErrMsgs
|
||||||
|
|
||||||
|
@ -749,6 +749,9 @@ class VariaRandomizer:
|
||||||
else:
|
else:
|
||||||
romPatcher = RomPatcher(magic=args.raceMagic)
|
romPatcher = RomPatcher(magic=args.raceMagic)
|
||||||
|
|
||||||
|
if customPrePatchApply != None:
|
||||||
|
customPrePatchApply(romPatcher)
|
||||||
|
|
||||||
if args.hud == True or args.majorsSplit == "FullWithHUD":
|
if args.hud == True or args.majorsSplit == "FullWithHUD":
|
||||||
args.patches.append("varia_hud.ips")
|
args.patches.append("varia_hud.ips")
|
||||||
if args.patchOnly == False:
|
if args.patchOnly == False:
|
||||||
|
@ -767,8 +770,8 @@ class VariaRandomizer:
|
||||||
# don't color randomize custom ships
|
# don't color randomize custom ships
|
||||||
args.shift_ship_palette = False
|
args.shift_ship_palette = False
|
||||||
|
|
||||||
if customPatchApply != None:
|
if customPostPatchApply != None:
|
||||||
customPatchApply(romPatcher)
|
customPostPatchApply(romPatcher)
|
||||||
|
|
||||||
# we have to write ips to ROM before doing our direct modifications which will rewrite some parts (like in credits),
|
# we have to write ips to ROM before doing our direct modifications which will rewrite some parts (like in credits),
|
||||||
# but in web mode we only want to generate a global ips at the end
|
# but in web mode we only want to generate a global ips at the end
|
||||||
|
|
Loading…
Reference in New Issue