Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 6217 - Too many gunners for aerospace in MekHQ - Unified Aerosp… #6218

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions megamek/src/megamek/common/Compute.java
Original file line number Diff line number Diff line change
Expand Up @@ -7294,6 +7294,11 @@ public static int getTotalGunnerNeeds(Entity entity) {
continue;
}
if (type instanceof WeaponType) {
if ((((WeaponType) m.getType()).getLongRange() <= 1)
// MML range depends on ammo, and getLongRange() returns 0
&& (((WeaponType) m.getType()).getAmmoType() != AmmoType.T_MML)) {
continue;
}
if (((WeaponType) type).isCapital()) {
nCapitalW++;
} else {
Expand Down
23 changes: 1 addition & 22 deletions megamek/src/megamek/common/verifier/TestAero.java
Original file line number Diff line number Diff line change
Expand Up @@ -1240,28 +1240,7 @@ public static int minimumBaseCrew(Aero aero) {
* @return The vessel's minimum gunner requirements.
*/
public static int requiredGunners(Aero aero) {
if (!aero.isLargeCraft() && !aero.hasETypeFlag(Entity.ETYPE_SMALL_CRAFT)) {
return 0;
}
int capitalWeapons = 0;
int stdWeapons = 0;
for (Mounted<?> m : aero.getTotalWeaponList()) {
if (m.getType() instanceof BayWeapon) {
continue;
}
if ((((WeaponType) m.getType()).getLongRange() <= 1)
// MML range depends on ammo, and getLongRange() returns 0
&& (((WeaponType) m.getType()).getAmmoType() != AmmoType.T_MML)) {
continue;
}
if (((WeaponType) m.getType()).isCapital()
|| (m.getType() instanceof ScreenLauncherWeapon)) {
capitalWeapons++;
} else {
stdWeapons++;
}
}
return capitalWeapons + (int) Math.ceil(stdWeapons / 6.0);
return Compute.getTotalGunnerNeeds(aero);
}

/**
Expand Down