Skip to content

Commit

Permalink
Merge pull request #848 from MegaMek/clan_case
Browse files Browse the repository at this point in the history
Retain and update Clan CASE
  • Loading branch information
neoancient authored Dec 21, 2020
2 parents df89696 + db7e924 commit 6c98955
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/megameklab/com/ui/Mek/tabs/EquipmentTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ private void loadEquipmentTable() {
&& !etype.hasSubType(MiscType.S_SUPERCHARGER))
|| ((getMech().getEntityType() & Entity.ETYPE_QUADVEE) == Entity.ETYPE_QUADVEE
&& etype.hasFlag(MiscType.F_TRACKS))
|| UnitUtil.isArmorOrStructure(etype)) {
|| UnitUtil.isArmorOrStructure(etype)
|| (etype.hasFlag(MiscType.F_CASE) && etype.isClan())) {
continue;
}
//if (UnitUtil.isUnitEquipment(mount.getType(), unit) || UnitUtil.isUn) {
Expand Down
7 changes: 6 additions & 1 deletion src/megameklab/com/util/UnitUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,9 @@ public static void addMounted(Entity unit, Mounted mounted, int loc,
boolean rearMounted) throws LocationFullException {
unit.addEquipment(mounted, loc, rearMounted);
mounted.setOmniPodMounted(canPodMount(unit, mounted));
if (mounted.getType().isExplosive(mounted, true) && (unit instanceof Mech) && unit.isClan()) {
((Mech) unit).addClanCase();
}
}

/**
Expand Down Expand Up @@ -1227,6 +1230,9 @@ public static void changeMountStatus(Entity unit, Mounted eq, int location,
// Exception thrown for not having equipment to link to yet, which is acceptable here
}
}
if (eq.getType().isExplosive(eq, true) && (unit instanceof Mech) && unit.isClan()) {
((Mech) unit).addClanCase();
}
}

public static void resizeMount(Mounted mount, double newSize) {
Expand Down Expand Up @@ -2534,7 +2540,6 @@ public static void updateLoadedUnit(Entity unit) {
}

public static void updateLoadedMech(Mech unit) {
UnitUtil.removeClanCase(unit);
UnitUtil.expandUnitMounts(unit);
UnitUtil.checkArmor(unit);
}
Expand Down

0 comments on commit 6c98955

Please sign in to comment.