mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 14:45:35 +00:00
Less hacks to get the same thing done
This commit is contained in:
@@ -557,17 +557,13 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength',
|
||||
return this;
|
||||
};
|
||||
|
||||
Ship.prototype.useWeapon = function(group, mount) {
|
||||
Ship.prototype.useWeapon = function(group, mount, missile) {
|
||||
var hps = this.hardpoints;
|
||||
for (var i = hps.length; i--; ) {
|
||||
if (hps[i].maxClass) {
|
||||
var size = hps[i].maxClass, component;
|
||||
do {
|
||||
if (group == 'mr') {
|
||||
component = Components.findHardpoint(group, size, null, null, 'F', mount);
|
||||
} else {
|
||||
component = Components.findHardpoint(group, size, null, null, mount);
|
||||
}
|
||||
component = Components.findHardpoint(group, size, null, null, mount, missile);
|
||||
if (component) {
|
||||
this.use(hps[i], component.id, component);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user