DS3: Explicitly track item equality by name when sending IDs (#3853)

We had been keeping a set of items and defining item equality, but
item equality really only makes sense if you consider distinct IDs to
be distinct items. But that means the set ends up having multiple
copies of the same item, causing a bug where some items had the wrong
upgrade level in the game.

This also removes the equality definition, which was only used by this
one set.
This commit is contained in:
Natalie Weizenbaum
2024-08-30 03:26:49 -07:00
committed by GitHub
parent 08dc7e522e
commit b1be597451
2 changed files with 7 additions and 13 deletions

View File

@@ -238,15 +238,6 @@ class DS3ItemData:
ds3_code = cast(int, self.ds3_code) + level,
filler = False,
)
def __hash__(self) -> int:
return (self.name, self.ds3_code).__hash__()
def __eq__(self, other: Any) -> bool:
if isinstance(other, self.__class__):
return self.name == other.name and self.ds3_code == other.ds3_code
else:
return False
class DarkSouls3Item(Item):