mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-10 07:05:35 +00:00
Remove arg overloading in useUtility
This commit is contained in:
@@ -547,13 +547,8 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength',
|
|||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
Ship.prototype.useUtility = function(group, rating, clobber) {
|
Ship.prototype.useUtility = function(group, rating, name, clobber) {
|
||||||
var component;
|
var component = Components.findHardpoint(group, 0, rating, name);
|
||||||
if (group == 'cm') {
|
|
||||||
component = Components.findHardpoint(group, 0, null, rating); //overload Rating as Name for countermeasures
|
|
||||||
} else {
|
|
||||||
component = Components.findHardpoint(group, 0, rating);
|
|
||||||
}
|
|
||||||
for (var i = this.hardpoints.length; i--; ) {
|
for (var i = this.hardpoints.length; i--; ) {
|
||||||
if ((clobber || !this.hardpoints[i].c) && !this.hardpoints[i].maxClass) {
|
if ((clobber || !this.hardpoints[i].c) && !this.hardpoints[i].maxClass) {
|
||||||
this.use(this.hardpoints[i], component.id, component);
|
this.use(this.hardpoints[i], component.id, component);
|
||||||
|
|||||||
@@ -298,7 +298,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<div class="select-group cap" translate="Heat Sink Launcher"></div>
|
<div class="select-group cap" translate="Heat Sink Launcher"></div>
|
||||||
<ul>
|
<ul>
|
||||||
<li class="lc" ng-click="useUtility('cm','Heat Sink Launcher')" translate="Heat Sink Launcher"></li>
|
<li class="lc" ng-click="useUtility('cm',null,'Heat Sink Launcher')" translate="Heat Sink Launcher"></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user