mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-10 07:05:35 +00:00
Linting fix
This commit is contained in:
@@ -173,7 +173,7 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength',
|
|||||||
Ship.prototype.use = function(slot, id, component, preventUpdate) {
|
Ship.prototype.use = function(slot, id, component, preventUpdate) {
|
||||||
if (slot.id != id) { // Selecting a different component
|
if (slot.id != id) { // Selecting a different component
|
||||||
// Slot is an internal slot, is not being emptied, and the selected component group/type must be of unique
|
// Slot is an internal slot, is not being emptied, and the selected component group/type must be of unique
|
||||||
if (slot.cat == 2 && component && _.includes(['psg','sg', 'rf', 'fs'], component.grp)) {
|
if (slot.cat == 2 && component && _.includes(['psg', 'sg', 'rf', 'fs'], component.grp)) {
|
||||||
// Find another internal slot that already has this type/group installed
|
// Find another internal slot that already has this type/group installed
|
||||||
var similarSlot = this.findInternalByGroup(component.grp);
|
var similarSlot = this.findInternalByGroup(component.grp);
|
||||||
// If another slot has an installed component with of the same type
|
// If another slot has an installed component with of the same type
|
||||||
@@ -210,12 +210,13 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength',
|
|||||||
* @return {number} The index of the slot in ship.internal
|
* @return {number} The index of the slot in ship.internal
|
||||||
*/
|
*/
|
||||||
Ship.prototype.findInternalByGroup = function(group) {
|
Ship.prototype.findInternalByGroup = function(group) {
|
||||||
if(group == 'sg' || group == 'psg') {
|
var index;
|
||||||
var index = _.findIndex(this.internal, function(slot) {
|
if (group == 'sg' || group == 'psg') {
|
||||||
|
index = _.findIndex(this.internal, function(slot) {
|
||||||
return slot.c && (slot.c.grp == 'sg' || slot.c.grp == 'psg');
|
return slot.c && (slot.c.grp == 'sg' || slot.c.grp == 'psg');
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
var index = _.findIndex(this.internal, function(slot) {
|
index = _.findIndex(this.internal, function(slot) {
|
||||||
return slot.c && slot.c.grp == group;
|
return slot.c && slot.c.grp == group;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user