Remove arg overloading in useUtility

This commit is contained in:
Kevin Chang
2015-11-16 16:36:15 -08:00
parent f5127c2475
commit 41c4b4243a
2 changed files with 3 additions and 8 deletions

View File

@@ -547,13 +547,8 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength',
return this;
};
Ship.prototype.useUtility = function(group, rating, clobber) {
var component;
if (group == 'cm') {
component = Components.findHardpoint(group, 0, null, rating); //overload Rating as Name for countermeasures
} else {
component = Components.findHardpoint(group, 0, rating);
}
Ship.prototype.useUtility = function(group, rating, name, clobber) {
var component = Components.findHardpoint(group, 0, rating, name);
for (var i = this.hardpoints.length; i--; ) {
if ((clobber || !this.hardpoints[i].c) && !this.hardpoints[i].maxClass) {
this.use(this.hardpoints[i], component.id, component);