Skip to content

Commit

Permalink
Set level taken when adding a feat (foundryvtt#14849)
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosFdez committed May 29, 2024
1 parent 72def9e commit c0de6bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/module/actor/character/feats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,9 @@ class FeatGroup<TActor extends ActorPF2e = ActorPF2e, TItem extends FeatLike = F

// If this is a new feat, create a new feat item on the actor first
if (!alreadyHasFeat && (isFeatValidInSlot || !location)) {
const source = fu.mergeObject(feat.toObject(), { system: { location } });
const source = fu.mergeObject(feat.toObject(), {
system: { location, level: { taken: slot?.level ?? this.actor.level } },
});
changed.push(...(await this.actor.createEmbeddedDocuments("Item", [source])));
const label = game.i18n.localize(this.label);
ui.notifications.info(game.i18n.format("PF2E.Item.Feat.Info.Added", { item: feat.name, category: label }));
Expand Down

0 comments on commit c0de6bc

Please sign in to comment.