Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: add correct flags to precollected items #2059

Closed
wants to merge 11 commits into from
2 changes: 1 addition & 1 deletion Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def write_multidata():
games[slot] = world.game[slot]
slot_info[slot] = NetUtils.NetworkSlot(group["name"], world.game[slot], world.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 world.precollected_items.items()}
precollected_hints = {player: set() for player in range(1, world.players + 1 + len(world.groups))}

Expand Down
9 changes: 6 additions & 3 deletions MultiServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 in version 0.4.5
kindasneaki marked this conversation as resolved.
Show resolved Hide resolved
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)

Expand Down
Loading