Merge pull request #224 from unrealkakeman89/power-cell-fix

Always create a new power cell
This commit is contained in:
CK 2021-06-23 13:04:18 -04:00 committed by GitHub
commit bac8e3d642
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -664,7 +664,7 @@ export default class ActorSheet5e extends ActorSheet {
return sourceId && (sourceId === itemData.flags.core?.sourceId) &&
(i.type === "consumable");
});
if ( similarItem ) {
if ( similarItem && itemData.name !== "Power Cell" ) { // Always create a new powercell instead of increasing quantity
return similarItem.update({
'data.quantity': similarItem.data.data.quantity + Math.max(itemData.data.quantity, 1)
});