Skip to content

Commit

Permalink
Merge pull request #4007 from SJuliez/WeaponSplitCT_H
Browse files Browse the repository at this point in the history
Allow split weapons between CT and H locations
  • Loading branch information
SJuliez authored Nov 26, 2022
2 parents 7352485 + 393d97e commit 4410f90
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions megamek/src/megamek/common/loaders/MtfFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -741,14 +741,15 @@ private void parseCrits(Mech mech, int loc) throws EntityLoadingException {
m.setOmniPodMounted(isOmniPod);
hSharedEquip.put(etype, m);
} else if (((etype instanceof WeaponType) && ((WeaponType) etype).isSplitable()) || ((etype instanceof MiscType) && etype.hasFlag(MiscType.F_SPLITABLE))) {
// do we already have this one in this or an outer
// location?
// do we already have this one in this or an outer location?
Mounted m = null;
boolean bFound = false;
for (Mounted vSplitWeapon : vSplitWeapons) {
m = vSplitWeapon;
int nLoc = m.getLocation();
if (((nLoc == loc) || (loc == Mech.getInnerLocation(nLoc))) && (m.getType() == etype)) {
if ((((nLoc == loc) || (loc == Mech.getInnerLocation(nLoc)))
|| ((nLoc == Mech.LOC_CT) && (loc == Mech.LOC_HEAD)))
&& (m.getType() == etype)) {
bFound = true;
break;
}
Expand Down

0 comments on commit 4410f90

Please sign in to comment.