mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 22:33:24 +00:00
Handle comparison when build is missing. Closes #96
This commit is contained in:
@@ -20,6 +20,11 @@ angular.module('app').controller('ComparisonController', ['lodash', '$rootScope'
|
||||
$scope.addBuild = function(id, name, code) {
|
||||
var data = Ships[id]; // Get ship properties
|
||||
code = code ? code : Persist.builds[id][name]; // Retrieve build code if not passed
|
||||
|
||||
if (!code) { // No build found
|
||||
return;
|
||||
}
|
||||
|
||||
var b = new Ship(id, data.properties, data.slots); // Create a new Ship instance
|
||||
Serializer.toShip(b, code); // Populate components from code
|
||||
// Extend ship instance and add properties below
|
||||
|
||||
Reference in New Issue
Block a user