fixes NPE as ranged items could be equipped when the actor doesnt even have the skill to do so.
parent
eca965e434
commit
c00a6b11b7
|
|
@ -479,17 +479,19 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
||||||
|
|
||||||
if (fernkampf) {
|
if (fernkampf) {
|
||||||
const fkitems = fernkampf.system.rangedSkills.map((skillInQuestion) => actorData.items.find(p => p.name === skillInQuestion))
|
const fkitems = fernkampf.system.rangedSkills.map((skillInQuestion) => actorData.items.find(p => p.name === skillInQuestion))
|
||||||
fkitems.forEach(skill => {
|
fkitems?.forEach(skill => {
|
||||||
context.attacks.push({
|
if (skill) {
|
||||||
name: skill.name,
|
context.attacks.push({
|
||||||
id: fernkampf._id,
|
name: skill.name,
|
||||||
skillId: skill._id,
|
id: fernkampf._id,
|
||||||
using: fernkampf.name,
|
skillId: skill._id,
|
||||||
isRanged: true,
|
using: fernkampf.name,
|
||||||
at: `${this.document.system.fk.aktuell + skill.system.at}`,
|
isRanged: true,
|
||||||
tp: `${fernkampf.system.rangedAttackDamage}`,
|
at: `${this.document.system.fk.aktuell + skill.system.at}`,
|
||||||
ini: `${context.inidice}w6 + ${context.inivalue + fernkampf.system.iniModifier ?? 0}`,
|
tp: `${fernkampf.system.rangedAttackDamage}`,
|
||||||
})
|
ini: `${context.inidice}w6 + ${context.inivalue + fernkampf.system.iniModifier ?? 0}`,
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (links) {
|
if (links) {
|
||||||
|
|
@ -500,7 +502,7 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
||||||
meitems.push(item)
|
meitems.push(item)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
meitems.forEach(skill => {
|
meitems?.forEach(skill => {
|
||||||
const obj = skill
|
const obj = skill
|
||||||
context.attacks.push({
|
context.attacks.push({
|
||||||
name: obj.name,
|
name: obj.name,
|
||||||
|
|
@ -523,7 +525,7 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
||||||
meitems.push(item)
|
meitems.push(item)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
meitems.forEach(skill => {
|
meitems?.forEach(skill => {
|
||||||
const obj = skill
|
const obj = skill
|
||||||
context.attacks.push({
|
context.attacks.push({
|
||||||
name: obj.name,
|
name: obj.name,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue