Fix #113 weapon modules
This commit is contained in:
parent
0d70783e9b
commit
37d27104fc
@ -194,8 +194,13 @@ export class PegasusActor extends Actor {
|
||||
let comp = this.items.filter(item => item.type == 'vehiclemodule');
|
||||
return comp;
|
||||
}
|
||||
getVehicleWeaponModules() {
|
||||
let comp = this.items.filter(item => item.type == 'vehicleweaponmodule' && item.system.activated);
|
||||
getVehicleWeaponModules( activated = false ) {
|
||||
let comp = []
|
||||
if (activated ) {
|
||||
comp = this.items.filter(item => item.type == 'vehicleweaponmodule' && item.system.activated)
|
||||
} else {
|
||||
comp = this.items.filter(item => item.type == 'vehicleweaponmodule' )
|
||||
}
|
||||
return comp;
|
||||
}
|
||||
|
||||
@ -1801,7 +1806,7 @@ export class PegasusActor extends Actor {
|
||||
}
|
||||
addVehicleWeapons(rollData, vehicle) {
|
||||
if (vehicle) {
|
||||
let modules = vehicle.items.filter(vehicle => vehicle.type == "vehicleweaponmodule")
|
||||
let modules = vehicle.items.filter(item => item.type == "vehicleweaponmodule" && item.system.activated)
|
||||
if (modules && modules.length > 0) {
|
||||
for (let module of modules) {
|
||||
rollData.vehicleWeapons.push({ label: `Weapon ${module.name}`, type: "item", applied: false, weapon: module, value: module.system.damagedicevalue })
|
||||
|
Loading…
Reference in New Issue
Block a user