aikaterna/gobcog

[Bug] Tinker 2h item duplication

aikaterna opened this issue · 1 comments

Complete these first

  • I confirm that I am the owner of the bot running Adventure.
  • I confirm that I have not modified the source code of Adventure. :trollface:
  • I'm an Adventure user but not the bot owner.
  • I confirm that I have checked the issue tracker and a this bug hasn't been reported already.

Expected Behavior

Tinkers should only have one copy of their item

Current Behavior

This is 3.4.4 (PR)

See attachments where Axas has his apocolypse staff equipped and also in the backpack.
stats
backpack

There is also another user with 8x of their tinker item in their backpack currently.

Possible Solution

Not sure what's going on here. Haven't caught a duplication yet so not sure what triggers it.
Seems like it's rebirth related. Possibly related to

gobcog/adventure/charsheet.py

Lines 1631 to 1647 in 7721dbf

self.keep_equipped()
backpack = {}
for item in [
self.head,
self.chest,
self.gloves,
self.belt,
self.legs,
self.boots,
self.left,
self.right,
self.ring,
self.charm,
self.neck,
]:
if item and item.to_json() not in list(self.pieces_to_keep.values()):
await self.add_to_backpack(item)

Steps to Reproduce

  1. Rebirth with a 2 handed tinker weapon.

Context (Environment)

It's not hurting anything (yet) but it's causing questions.

Detailed Description

The tinker item should only be in one place at a time. No interdimensional tinker items please.

Possible Implementation

Magic. Specifically Draper magic.
Also Axas' answer in https://discord.com/channels/154659242253484033/154659242253484033/808481778582552596

This apparently also affects 2h weapons for classes other than tinker as well on rebirth. Had an item duplicate when rebirthing after having it equipped.