diff --git a/Main.py b/Main.py index f1d2f63692d6..7ce8fd358e3a 100644 --- a/Main.py +++ b/Main.py @@ -352,7 +352,7 @@ def write_multidata(): games[slot] = multiworld.game[slot] slot_info[slot] = NetUtils.NetworkSlot(group["name"], multiworld.game[slot], multiworld.player_types[slot], group_members=sorted(group["players"])) - precollected_items = {player: [item.code for item in world_precollected if type(item.code) == int] + precollected_items = {player: [(item.code, item.flags) for item in world_precollected if type(item.code) == int] for player, world_precollected in multiworld.precollected_items.items()} precollected_hints = {player: set() for player in range(1, multiworld.players + 1 + len(multiworld.groups))} diff --git a/MultiServer.py b/MultiServer.py index 62dab3298e6b..14f512317cb4 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -431,9 +431,12 @@ def _load(self, decoded_obj: dict, game_data_packages: typing.Dict[str, typing.A for player, loc_data in decoded_obj["er_hint_data"].items()} # load start inventory: - for slot, item_codes in decoded_obj["precollected_items"].items(): - self.start_inventory[slot] = [NetworkItem(item_code, -2, 0) for item_code in item_codes] - + for slot, items in decoded_obj["precollected_items"].items(): + # TODO: remove conditionals after version 0.4.5 and reject loading old multidata + if items and isinstance(items[0], tuple): + self.start_inventory[slot] = [NetworkItem(item_code, -2, 0, flags) for item_code, flags in items] + else: + self.start_inventory[slot] = [NetworkItem(item_code, -2, 0) for item_code in items] for slot, hints in decoded_obj["precollected_hints"].items(): self.hints[0, slot].update(hints)