Improved armor source names (#1851)

This commit is contained in:
WBHarry 2026-05-01 22:53:20 +02:00 committed by GitHub
parent 905d1f7e88
commit d0c2c783f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 9 deletions

View file

@ -757,9 +757,12 @@ export function getArmorSources(actor) {
// Get the origin item. Since the actor is already loaded, it should already be cached
// Consider the relative function versions if this causes an issue
const origin = doc.origin ? foundry.utils.fromUuidSync(doc.origin) : doc;
const useParentName = doc.parent && !(doc.parent instanceof Actor);
const name = doc.origin || !useParentName ? doc.name : doc.parent.name;
return {
origin,
name: origin.name,
name,
document: doc,
data: doc.system.armor ?? doc.system.armorData,
disabled: !!doc.disabled || !!doc.isSuppressed