Tomm0017 / rsmod

New repository: https://github.com/rsmod/rsmod
https://github.com/rsmod/rsmod
Apache License 2.0
123 stars 100 forks source link

Retaining item attributes when adding to new container #117

Closed ushort closed 5 years ago

ushort commented 5 years ago

Current Behavior

Assigning attributes to item then unequipping (and probably trading) said item would lose attributes. This is due to the fact that unequipping items and trading transfer the item to new container using https://github.com/Tomm0017/rsmod/blob/8cd9240c486585d1c778939a0826af8f65e0608b/game/src/main/kotlin/gg/rsmod/game/model/container/ItemContainer.kt#L213 which only retains item id and amount.

Expected Behavior

Attributes should carry over when creating the new item and adding to new container. Possibly send the item object itself then when creating new item use https://github.com/Tomm0017/rsmod/blob/266684c974f16049bcd93b27330cfca873c49ef0/game/src/main/kotlin/gg/rsmod/game/model/item/Item.kt#L65

Steps to Reproduce the Problem

  1. Assign an attribute to an equippable item such as ItemAttribute.CHARGES
  2. Equip then unequip the item and attributes will dissapear
  3. Fix :^]
Tomm0017 commented 5 years ago

Blocked by #127.

Will be revisited once above system is in place.