Skip to content

Commit

Permalink
fix(Mech Sheet): fixed engineer integrated weapon not updating correctly
Browse files Browse the repository at this point in the history
Closes #763
  • Loading branch information
jarena-qsr committed May 20, 2020
1 parent 7cec578 commit 2d3805b
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/classes/mech/MechLoadout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,20 @@ class MechLoadout extends Loadout {
}

public UpdateIntegrated(mech: Mech): void {
this._integratedSystems.forEach((s, idx) => {
if (!mech.IntegratedSystems.find(x => x.ID === s.ID)) this._integratedSystems.splice(idx, 1)
})
this._integratedSystems.splice(0, this._integratedSystems.length)

mech.IntegratedSystems.forEach(s => {
if (!this._integratedSystems.find(x => x.ID === s.ID)) this._integratedSystems.push(s)
this._integratedSystems.push(s)
})

this._integratedMounts.forEach((s, idx) => {
console.log('finding currently installed ', s)
if (!mech.IntegratedMounts.find(x => x.ItemSource === s.ItemSource))
console.log('not found: ', s.ItemSource)
this._integratedMounts.splice(idx, 1)
})
this._integratedMounts.splice(0, this._integratedMounts.length)

mech.IntegratedMounts.forEach(s => {
console.log(s)
if (!this._integratedMounts.find(x => x.ItemSource === s.ItemSource))
console.log('not found int mount')
this._integratedMounts.push(s)
})

console.log(this._integratedMounts)

this.save()
}

Expand Down

0 comments on commit 2d3805b

Please sign in to comment.