fix import issue with whitespace around terms
parent
c785a57666
commit
2f3b5526eb
|
|
@ -293,7 +293,7 @@ export class AdvantageSheet extends HandlebarsApplicationMixin(DocumentSheetV2)
|
|||
|
||||
_onRender(context, options) {
|
||||
if (this._selectedVariant == null) {
|
||||
this._selectedVariant = this.document.system.auswahl[0].name
|
||||
this._selectedVariant = this.document.system.auswahl?.[0]?.name ?? ""
|
||||
this._currentSelectedVariant = this.document.system.auswahl?.find(p => p.name === this._selectedVariant)
|
||||
this._currentSelectedVariantIndex = this.document.system.auswahl?.findIndex(p => p.name === this._selectedVariant)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ export class XmlImport {
|
|||
|
||||
async #addSkillFromCompendiumByNameToActor(talentName, taw, actor, combatStatistics, attributes) {
|
||||
const compendiumOfSkills = game.packs.get('DSA_4-1.Skills');
|
||||
const talentId = compendiumOfSkills.index.find(skill => skill.name === talentName)
|
||||
const talentId = compendiumOfSkills.index.find(skill => skill.name.trim() === talentName.trim())
|
||||
if (talentId) {
|
||||
|
||||
const talent = await compendiumOfSkills.getDocument(talentId._id);
|
||||
|
|
@ -368,7 +368,7 @@ export class XmlImport {
|
|||
|
||||
async #addAdvantageFromCompendiumByNameToActor(advantageName, advantageValue, actor) {
|
||||
const compendiumOfAdvantages = game.packs.get('DSA_4-1.Advantage');
|
||||
const advantageId = compendiumOfAdvantages.index.find(skill => skill.name === advantageName)
|
||||
const advantageId = compendiumOfAdvantages.index.find(skill => skill.name.trim() === advantageName.trim())
|
||||
if (advantageId) {
|
||||
|
||||
const advantage = await compendiumOfAdvantages.getDocument(advantageId._id);
|
||||
|
|
@ -385,7 +385,7 @@ export class XmlImport {
|
|||
async #addSpellsFromCompendiumByNameToActor(spellName, zfw, representation, hauszauber, actor) {
|
||||
const compendiumOfSpells = game.packs.get('DSA_4-1.Spells')
|
||||
const SCREAMING_NAME = spellName.toUpperCase()
|
||||
const spellId = compendiumOfSpells.index.find(spell => spell.name === SCREAMING_NAME)
|
||||
const spellId = compendiumOfSpells.index.find(spell => spell.name.trim() === SCREAMING_NAME.trim())
|
||||
if (spellId) {
|
||||
|
||||
const spell = await compendiumOfSpells.getDocument(spellId._id);
|
||||
|
|
@ -403,7 +403,7 @@ export class XmlImport {
|
|||
async #addLiturgiesFromCompendiumByNameToActor(liturgyName, actor) {
|
||||
const compendiumOfLiturgies = game.packs.get('DSA_4-1.Liturgies');
|
||||
const liturgyId = compendiumOfLiturgies.index.find(liturgy => {
|
||||
return liturgy.name === LiturgyData.lookupAlias(liturgyName.split(" (")[0])
|
||||
return liturgy.name.trim() === LiturgyData.lookupAlias(liturgyName.split(" (")[0]).trim()
|
||||
})
|
||||
if (liturgyId) {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue