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