Skip to content

Commit 002debd

Browse files
authored
Merge pull request #85 from ManualForArchipelago/extras-should-use-get-filler-name-too
Filler placement at end of `create_items` should also use `get_filler_item_name()`
2 parents 994fc5b + 7bc55d1 commit 002debd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ class ManualWorld(World):
5454
item_name_to_item = item_name_to_item
5555
item_name_groups = item_name_groups
5656

57+
filler_item_name = filler_item_name
58+
5759
item_counts = {}
5860
start_inventory = {}
5961

@@ -64,7 +66,7 @@ class ManualWorld(World):
6466
victory_names = victory_names
6567

6668
def get_filler_item_name(self) -> str:
67-
return hook_get_filler_item_name(self, self.multiworld, self.player) or filler_item_name
69+
return hook_get_filler_item_name(self, self.multiworld, self.player) or self.filler_item_name
6870

6971
def interpret_slot_data(self, slot_data: dict[str, any]):
7072
#this is called by tools like UT
@@ -106,8 +108,10 @@ def create_items(self):
106108
configured_item_names = self.item_id_to_name.copy()
107109

108110
for name in configured_item_names.values():
111+
# victory gets placed via place_locked_item at the victory location in create_regions
109112
if name == "__Victory__": continue
110-
if name == filler_item_name: continue
113+
# the game.json filler item name is added to the item lookup, so skip it until it's potentially needed later
114+
if name == filler_item_name: continue # intentionally using the Game.py filler_item_name here because it's a non-Items item
111115

112116
item = self.item_name_to_item[name]
113117
item_count = int(item.get("count", 1))
@@ -370,7 +374,7 @@ def adjust_filler_items(self, item_pool, traps):
370374
item_pool.append(extra_item)
371375

372376
for _ in range(0, filler_count):
373-
extra_item = self.create_item(filler_item_name)
377+
extra_item = self.create_item(self.get_filler_item_name())
374378
item_pool.append(extra_item)
375379
elif extras < 0:
376380
logging.warning(f"{self.game} has more items than locations. {abs(extras)} non-progression items will be removed at random.")

0 commit comments

Comments
 (0)