This closes #435. Overwrote toObject method to include item cost since that is what Item Piles module uses to determine cost.
Initially attempted to add a getter to system.cost, but that didn't work because Item Piles uses toObject first. Since there is no constructor, the best placed I figured I could put the cost getter would be in prepareData, but there were cases where you could have an item in an Item Pile without triggering prepareData so rather than using a getter, I just put the getter logic inside the toObject override method.
This closes #435. Overwrote
toObject
method to include item cost since that is what Item Piles module uses to determine cost.Initially attempted to add a getter to
system.cost
, but that didn't work because Item Piles usestoObject
first. Since there is no constructor, the best placed I figured I could put thecost
getter would be inprepareData
, but there were cases where you could have an item in an Item Pile without triggeringprepareData
so rather than using a getter, I just put the getter logic inside thetoObject
override method.