ArchipelagoMW-HollowKnight / Archipelago.HollowKnight

Hollow Knight mod enabling Archipelago multiworld interoperability.
MIT License
5 stars 10 forks source link

Collected items are not handled during gameplay #222

Open thislooksfun opened 4 months ago

thislooksfun commented 4 months ago

Describe the bug Any items that are collected by another player (via the !collect or /collect commands) during gameplay are not handled until the save file is closed and re-loaded.

To Reproduce Steps to reproduce the behavior:

  1. Make a new multiworld randomizer with at least two players, at least one of which is playing HK
  2. Load the HK slot
  3. While HK is open, /collect or !collect the second player's items
  4. The items will still be marked as unchecked in the HK game
  5. Save and quit to the main menu in HK
  6. Reload the save file
  7. The items will now be marked as collected

Expected behavior I would expect the items to be marked as collected immediately (or at least on the next room transition).

Screenshots N/A

Additional context In reading through the code, I think this is due to only ever checking the AllLocationsChecked set during initial save loading, and never checking it again after that. I don't however know if the MultiWorld client has some exposed way to listen for changes that is not being subscribed to, or if this needs to be initially handled upstream.

thislooksfun commented 4 months ago

As I stated in this comment I think the cleanest way to handle this would be to display a single message whenever a player collects their items, if possible. That will avoid spamming the item displays with other players' items while still allowing the HK player to know that something has happened.