LADX: Fix generation error on minimal accessibility (#4281)

* [LADX] Fix minimal accessibility

* allow_partial for minimal accessibility

* create the correct partial_all_state

* skip our prefills rather than removing after

* dont rebuild our prefill list

---------

Co-authored-by: threeandthreee <a.l.nordstrom@gmail.com>
This commit is contained in:
Spineraks 2025-02-01 22:03:49 +01:00 committed by GitHub
parent d1167027f4
commit b7b78dead3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 18 additions and 12 deletions

View File

@ -9,7 +9,7 @@ import re
import bsdiff4 import bsdiff4
import settings import settings
from BaseClasses import Entrance, Item, ItemClassification, Location, Tutorial, MultiWorld from BaseClasses import CollectionState, Entrance, Item, ItemClassification, Location, Tutorial, MultiWorld
from Fill import fill_restrictive from Fill import fill_restrictive
from worlds.AutoWorld import WebWorld, World from worlds.AutoWorld import WebWorld, World
from .Common import * from .Common import *
@ -315,8 +315,6 @@ class LinksAwakeningWorld(World):
# Set up filter rules # Set up filter rules
# The list of items we will pass to fill_restrictive, contains at first the items that go to all dungeons
all_dungeon_items_to_fill = list(self.prefill_own_dungeons)
# set containing the list of all possible dungeon locations for the player # set containing the list of all possible dungeon locations for the player
all_dungeon_locs = set() all_dungeon_locs = set()
@ -327,9 +325,6 @@ class LinksAwakeningWorld(World):
for item in self.prefill_original_dungeon[dungeon_index]: for item in self.prefill_original_dungeon[dungeon_index]:
allowed_locations_by_item[item] = locs allowed_locations_by_item[item] = locs
# put the items for this dungeon in the list to fill
all_dungeon_items_to_fill.extend(self.prefill_original_dungeon[dungeon_index])
# ...and gather the list of all dungeon locations # ...and gather the list of all dungeon locations
all_dungeon_locs |= locs all_dungeon_locs |= locs
# ...also set the rules for the dungeon # ...also set the rules for the dungeon
@ -369,16 +364,27 @@ class LinksAwakeningWorld(World):
if allowed_locations_by_item[item] is all_dungeon_locs: if allowed_locations_by_item[item] is all_dungeon_locs:
i += 3 i += 3
return i return i
all_dungeon_items_to_fill = self.get_pre_fill_items()
all_dungeon_items_to_fill.sort(key=priority) all_dungeon_items_to_fill.sort(key=priority)
# Set up state # Set up state
all_state = self.multiworld.get_all_state(use_cache=False) partial_all_state = CollectionState(self.multiworld)
# Remove dungeon items we are about to put in from the state so that we don't double count # Collect every item from the item pool and every pre-fill item like MultiWorld.get_all_state, except not our own pre-fill items.
for item in all_dungeon_items_to_fill: for item in self.multiworld.itempool:
all_state.remove(item) partial_all_state.collect(item, prevent_sweep=True)
for player in self.multiworld.player_ids:
if player == self.player:
# Don't collect the items we're about to place.
continue
subworld = self.multiworld.worlds[player]
for item in subworld.get_pre_fill_items():
partial_all_state.collect(item, prevent_sweep=True)
# Sweep to pick up already placed items that are reachable with everything but the dungeon items.
partial_all_state.sweep_for_advancements()
# Finally, fill! fill_restrictive(self.multiworld, partial_all_state, all_dungeon_locs_to_fill, all_dungeon_items_to_fill, lock=True, single_player_placement=True, allow_partial=False)
fill_restrictive(self.multiworld, all_state, all_dungeon_locs_to_fill, all_dungeon_items_to_fill, lock=True, single_player_placement=True, allow_partial=False)
name_cache = {} name_cache = {}
# Tries to associate an icon from another game with an icon we have # Tries to associate an icon from another game with an icon we have