Use cargo hatch info on import if available

This commit is contained in:
Cmdr McDonald
2017-03-25 18:19:31 +00:00
parent f536c037b1
commit 442da6f05b
2 changed files with 10 additions and 3 deletions

View File

@@ -15,6 +15,7 @@
* Ignore rounds per shot for EPS and HPS calculations; it's already factored in to the numbers * Ignore rounds per shot for EPS and HPS calculations; it's already factored in to the numbers
* Ensure that clip size modification imports result in whole numbers * Ensure that clip size modification imports result in whole numbers
* Rework of separate offence/defence/movement sections to a unified interface * Rework of separate offence/defence/movement sections to a unified interface
* Use cargo hatch information on import if available
#2.2.19 #2.2.19
* Power management panel now displays modules in descending order of power usage by default * Power management panel now displays modules in descending order of power usage by default

View File

@@ -130,9 +130,15 @@ export function shipFromJson(json) {
let ship = new Ship(shipModel, shipTemplate.properties, shipTemplate.slots); let ship = new Ship(shipModel, shipTemplate.properties, shipTemplate.slots);
ship.buildWith(null); ship.buildWith(null);
// Set the cargo hatch. We don't have any information on it so guess it's priority 5 and disabled // Set the cargo hatch
ship.cargoHatch.enabled = false; if (json.modules.CargoHatch) {
ship.cargoHatch.priority = 4; ship.cargoHatch.enabled = json.modules.CargoHatch.module.on == true;
ship.cargoHatch.priority = json.modules.CargoHatch.module.priority;
} else {
// We don't have any information on it so guess it's priority 5 and disabled
ship.cargoHatch.enabled = false;
ship.cargoHatch.priority = 4;
}
// Add the bulkheads // Add the bulkheads
const armourJson = json.modules.Armour.module; const armourJson = json.modules.Armour.module;