Core: recontextualize CollectionState.collect (#3723)

* Core: renamed `CollectionState.collect` arg from `event` to `prevent_sweep` and remove forced collection

* Update TestDungeon.py

---------

Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
This commit is contained in:
Aaron Wagener
2024-08-13 15:28:05 -05:00
committed by GitHub
parent dcaa2f7b97
commit 96d48a923a
19 changed files with 146 additions and 150 deletions

View File

@@ -863,19 +863,15 @@ class CollectionState():
)
# Item related
def collect(self, item: Item, event: bool = False, location: Optional[Location] = None) -> bool:
def collect(self, item: Item, prevent_sweep: bool = False, location: Optional[Location] = None) -> bool:
if location:
self.locations_checked.add(location)
changed = self.multiworld.worlds[item.player].collect(self, item)
if not changed and event:
self.prog_items[item.player][item.name] += 1
changed = True
self.stale[item.player] = True
if changed and not event:
if changed and not prevent_sweep:
self.sweep_for_events()
return changed