Fix import and export of ships with modifications, bump schema version to 4

This commit is contained in:
Cmdr McDonald
2016-11-09 16:32:11 +00:00
parent c1bc514e6b
commit 38eaebefc0
15 changed files with 756 additions and 74 deletions

View File

@@ -212,6 +212,16 @@ export function findHardpoint(groupName, clss, rating, name, mount, missile) {
*/
export function findHardpointId(groupName, clss, rating, name, mount, missile) {
let h = this.findHardpoint(groupName, clss, rating, name, mount, missile);
if (h) {
return h.id;
}
// Countermeasures used to be lumped in a single group but have been broken, out. If we have been given a groupName of 'Countermeasure' then
// rely on the unique name to find it
if (groupName === 'cm' || groupName === 'Countermeasure') {
h = this.findHardpoint(null, clss, rating, name, mount, missile);
}
return h ? h.id : 0;
}