Skip to content

Commit

Permalink
closes #839
Browse files Browse the repository at this point in the history
  • Loading branch information
Muttley committed Jul 9, 2024
1 parent 6a0a678 commit b6773b7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,19 @@
- `system.attributes.ac.value` now always holds the current AC

* [#820] All ability scores now store a total value of base stats + modifiers. e.g. `system.abilities.str.total`
* [#833] Implemented rolls for NPC special attacks

## Bugfixes
* [#757] Special Attack Life Drain doesn't roll for attack
* [#809] Add new `grid.distance` and `grid.units` values to `system.json` *(Foundry V12 compatibility)*
* [#811] `description` typo in `system.json`
* [#814] The roll initiative button on the player sheet will no longer double roll when re-rolling initiative
* [#816] Updated Ranger Herbalism talent description to the latest version
* [#822] The spellbook now works for Knight of St. Ydris and other classes that use another class's spell list
* [#832] Melee weapons with the "Thrown" property now rolling correctly when used as a ranged attack
* [#835] Update Sleep spell description to the latest version
* [#837] AC not displaying consistently when adding effects
* [#839] Free Carry item calculation wrong if you have duplicate items instead of just using item quantity

## Chores
* [#813] Merged Finnish language updates from Crowdin
Expand Down
13 changes: 12 additions & 1 deletion system/src/sheets/PlayerSheetSD.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -827,14 +827,25 @@ export default class PlayerSheetSD extends ActorSheetSD {
gems: 0,
};

const freeCarrySeen = {};

for (const i of this._sortAllItems(context)) {
if (i.system.isPhysical && i.type !== "Gem") {
i.showQuantity = i.system.slots.per_slot > 1 ? true : false;

// We calculate how many slots are used by this item, taking
// into account the quantity and any free items.
//
const freeCarry = i.system.slots.free_carry;
let freeCarry = i.system.slots.free_carry;

if (Object.hasOwn(freeCarrySeen, i.name)) {
freeCarry = Math.max(0, freeCarry - freeCarrySeen[i.name]);
freeCarrySeen[i.name] += freeCarry;
}
else {
freeCarrySeen[i.name] = freeCarry;
}

const perSlot = i.system.slots.per_slot;
const quantity = i.system.quantity;
const slotsUsed = i.system.slots.slots_used;
Expand Down

0 comments on commit b6773b7

Please sign in to comment.