Archipelago
Archipelago copied to clipboard
Core - Added classification check to Item Equality
What is this fixing or adding?
Item equality comparison did not consider classifications. Since the case where the same item exists in many instances, with different classifications, is supported (and even often encouraged), this is a flaw in the system, where equality comparisons can get it wrong sometimes, for example removing or filtering the wrong items from collections
How was this tested?
Ran all the unit tests, plus my case that had a problem because of this
Discord Conversation: https://discord.com/channels/731205301247803413/731214280439103580/1222014497552597054
I wonder if a better solution might be checking that self is other
Seems like this would solve a lot of issues that have come up where .remove() removes the wrong instance of an item from a list, etc? Not sure if it might break anything anywhere though.
It has been discovered, shortly after the creation of this PR, that plando and start inventory from pool rely on this "incomplete" equality to work properly.
These would need to get fixed as well, for this PR to be acceptable.
This is now out of my area of expertise, so I'm leaving it to anyone who wishes to bother. I'll be working around the bug from now on
Incidentally I think self is other
would cause issues here as well
If this changes, the classification should also be added to __hash__