use of megamek.common.loaders.EntityLoadingException in project megameklab by MegaMek.
the class DropTargetCriticalList method changeArmoring.
private void changeArmoring() {
CriticalSlot cs = getCrit();
if (cs != null) {
if (cs.getType() == CriticalSlot.TYPE_EQUIPMENT) {
Mounted mount = getMounted();
mount.setArmored(!cs.isArmored());
UnitUtil.updateCritsArmoredStatus(getUnit(), mount);
} else {
cs.setArmored(!cs.isArmored());
UnitUtil.updateCritsArmoredStatus(getUnit(), cs, getCritLocation());
}
}
// Check linkings after you remove everything.
try {
MechFileParser.postLoadInit(getUnit());
} catch (EntityLoadingException ele) {
// do nothing.
} catch (Exception ex) {
ex.printStackTrace();
}
if (refresh != null) {
refresh.refreshAll();
}
}
use of megamek.common.loaders.EntityLoadingException in project megameklab by MegaMek.
the class BuildTab method resetCrits.
private void resetCrits() {
for (Mounted mount : getTank().getEquipment()) {
// Fixed shouldn't be removed
if (UnitUtil.isFixedLocationSpreadEquipment(mount.getType())) {
continue;
}
UnitUtil.removeCriticals(getTank(), mount);
UnitUtil.changeMountStatus(getTank(), mount, Entity.LOC_NONE, Entity.LOC_NONE, false);
}
// Check linkings after you remove everything.
try {
MechFileParser.postLoadInit(getTank());
} catch (EntityLoadingException ele) {
// do nothing.
} catch (Exception ex) {
ex.printStackTrace();
}
refresh.refreshAll();
}
Aggregations