Fix #3 v10 fixes for processing embedded items

This commit is contained in:
sladecraven 2022-09-25 14:26:18 +02:00
parent 7d3f880633
commit b185a3902d

View File

@ -1391,26 +1391,31 @@ export class PegasusActor extends Actor {
let newItems = [] let newItems = []
if (ability.system.effectsgained) { if (ability.system.effectsgained) {
for (let effect of ability.system.effectsgained) { for (let effect of ability.system.effectsgained) {
if (!effect.system) effect.system = effect.data
newItems.push(effect); newItems.push(effect);
} }
} }
if (ability.system.powersgained) { if (ability.system.powersgained) {
for (let power of ability.system.powersgained) { for (let power of ability.system.powersgained) {
if (!power.system) power.system = power.data
newItems.push(power); newItems.push(power);
} }
} }
if (ability.system.specialisations) { if (ability.system.specialisations) {
for (let spec of ability.system.specialisations) { for (let spec of ability.system.specialisations) {
if (!spec.system) spec.system = spec.data
newItems.push(spec); newItems.push(spec);
} }
} }
if (ability.system.attackgained) { if (ability.system.attackgained) {
for (let weapon of ability.system.attackgained) { for (let weapon of ability.system.attackgained) {
if (!weapon.system) weapon.system = weapon.data
newItems.push(weapon); newItems.push(weapon);
} }
} }
if (ability.system.armorgained) { if (ability.system.armorgained) {
for (let armor of ability.system.armorgained) { for (let armor of ability.system.armorgained) {
if (!armor.system) armor.system = armor.data
newItems.push(armor); newItems.push(armor);
} }
} }
@ -1427,11 +1432,13 @@ export class PegasusActor extends Actor {
console.log("DROPPED RACE", race) console.log("DROPPED RACE", race)
for (let ability of race.system.abilities) { for (let ability of race.system.abilities) {
if (!ability.system) ability.system = ability.data
newItems.push(ability) newItems.push(ability)
this.applyAbility(ability, updates) this.applyAbility(ability, updates)
} }
if (race.system.perksgained) { if (race.system.perksgained) {
for (let power of race.system.perks) { for (let power of race.system.perks) {
if (!power.system) power.system = power.data
newItems.push(power); newItems.push(power);
} }
} }
@ -1462,7 +1469,7 @@ export class PegasusActor extends Actor {
this.getIncreaseStatValue(updates, role.system.statincrease2) this.getIncreaseStatValue(updates, role.system.statincrease2)
if (role.system.specialability.length > 0) { if (role.system.specialability.length > 0) {
console.log("Adding ability", role.system.specialability) //console.log("Adding ability", role.system.specialability)
newItems = newItems.concat(duplicate(role.system.specialability)) // Add new ability newItems = newItems.concat(duplicate(role.system.specialability)) // Add new ability
this.applyAbility(role.system.specialability[0], newItems) this.applyAbility(role.system.specialability[0], newItems)
} }