Hyphen-ated / RebirthItemTracker

Uses the log.txt file to track item pickups in Binding of Isaac: Rebirth.
BSD 2-Clause "Simplified" License
121 stars 26 forks source link

Implement __hash__ for Item #75

Closed viroulep closed 8 years ago

viroulep commented 8 years ago

Fixes #63. Python uses hash method from objects to check if it's in a set. For Item we can just hash the id since two items are equal if their ids are equal.

For this issue, Guppy's paw was added twice to the set, therefore displaying a guppy counter of 2 instead of 1.

viroulep commented 8 years ago

Wait, floor layout is broken because of this for the first run, I'll look into this.

viroulep commented 8 years ago

Ok, so the caching system uses a set of items too, and floor drawing is based on this cached item floor, causing wrong floors to be displayed. (e.g. getting coal on c1 during a run, then getting it on b2 during the next run would cause the tracker to display floors as if you would have picked up coal on c1)

I updated the PR.