From e0aa52ed278d072f325f1f0a2a723aaf72a6e3b0 Mon Sep 17 00:00:00 2001 From: lordlou <87331798+lordlou@users.noreply.github.com> Date: Fri, 25 Mar 2022 21:35:55 -0400 Subject: [PATCH] [SMZ3] player count fix (#346) --- worlds/smz3/TotalSMZ3/Patch.py | 4 ++-- worlds/smz3/__init__.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/worlds/smz3/TotalSMZ3/Patch.py b/worlds/smz3/TotalSMZ3/Patch.py index f54a9d07..54395714 100644 --- a/worlds/smz3/TotalSMZ3/Patch.py +++ b/worlds/smz3/TotalSMZ3/Patch.py @@ -322,7 +322,7 @@ class Patch: def ItemTablePatch(self, location: Location, itemId: int): itemtype = 0 if location.APLocation.item.player == location.Region.world.Id else 1 - owner = location.APLocation.item.player + owner = location.APLocation.item.player if location.APLocation.item.player < 256 else 0 return (0x386000 + (location.Id * 8), getWordArray(itemtype) + getWordArray(itemId) + getWordArray(owner)) def WriteDungeonMusic(self, keysanity: bool): @@ -572,7 +572,7 @@ class Patch: def WritePlayerNames(self): self.patches += [(0x385000 + (0 * 16), self.PlayerNameBytes("Archipelago"))] - self.patches += [(0x385000 + (id * 16), self.PlayerNameBytes(name)) for name, id in self.playerNames.items()] + self.patches += [(0x385000 + (id * 16), self.PlayerNameBytes(name)) for name, id in self.playerNames.items() if id < 256] def PlayerNameBytes(self, name: str): name = (name[:16] if len(name) > 16 else name).center(16) diff --git a/worlds/smz3/__init__.py b/worlds/smz3/__init__.py index b0a5993b..30b6200b 100644 --- a/worlds/smz3/__init__.py +++ b/worlds/smz3/__init__.py @@ -135,6 +135,10 @@ class SMZ3World(World): startRegion.exits.append(exit) exit.connect(currentRegion) + def get_required_client_version(self): + # first added for 0.2.6 + return max(super(SMZ3World, self).get_required_client_version(), (0, 2, 6)) + def apply_sm_custom_sprite(self): itemSprites = ["off_world_prog_item.bin", "off_world_item.bin"] itemSpritesAddress = [0xF800, 0xF900]