diff --git a/ChangeLog.md b/ChangeLog.md
index cd9a709b..ede897fe 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -13,6 +13,8 @@
* Add tooltip for blueprints providing details of the features they alter
* Use opponent's saved pips if available
* Ignore rounds per shot for EPS and HPS calculations; it's already factored in to the numbers
+ * Ensure that clip size modification imports result in whole numbers
+ * Rework of separate offence/defence/movement sections to a unified interface
#2.2.19
* Power management panel now displays modules in descending order of power usage by default
diff --git a/src/app/components/CostSection.jsx b/src/app/components/CostSection.jsx
index f0dc5bfd..302dd5c8 100644
--- a/src/app/components/CostSection.jsx
+++ b/src/app/components/CostSection.jsx
@@ -507,7 +507,7 @@ export default class CostSection extends TranslatedComponent {
scoop = true;
break;
case 'scb':
- q = slotGroup[i].m.getCells();
+ q = slotGroup[i].m.getAmmo() + 1;
break;
case 'am':
q = slotGroup[i].m.getAmmo();
diff --git a/src/app/components/InternalSlot.jsx b/src/app/components/InternalSlot.jsx
index 562f7555..7c8c4063 100644
--- a/src/app/components/InternalSlot.jsx
+++ b/src/app/components/InternalSlot.jsx
@@ -52,14 +52,16 @@ export default class InternalSlot extends Slot {
{ m.bays ?
{translate('bays')}: {m.bays}
: null }
{ m.rebuildsperbay ? {translate('rebuildsperbay')}: {m.rebuildsperbay}
: null }
{ m.rate ? {translate('rate')}: {m.rate}{u.kgs} {translate('refuel time')}: {formats.time(this.props.fuel * 1000 / m.rate)}
: null }
- { m.getAmmo() ? {translate('ammunition')}: {formats.gen(m.getAmmo())}
: null }
- { m.cells ? {translate('cells')}: {m.cells}
: null }
- { m.getShieldReinforcement() ? {translate('shieldreinforcement')}: {formats.int(m.getShieldReinforcement())} MJ {translate('total')}: {formats.int(m.cells * m.getShieldReinforcement())}{u.MJ}
: null }
+ { m.getAmmo() && m.grp !== 'scb' ? {translate('ammunition')}: {formats.gen(m.getAmmo())}
: null }
+ { m.getSpinup() ? {translate('spinup')}: {formats.f1(m.getSpinup())}{u.s}
: null }
+ { m.getDuration() ? {translate('duration')}: {formats.f1(m.getDuration())}{u.s}
: null }
+ { m.grp === 'scb' ? {translate('cells')}: {formats.int(m.getAmmo() + 1)}
: null }
+ { m.getShieldReinforcement() ? {translate('shieldreinforcement')}: {formats.f1(m.getDuration() * m.getShieldReinforcement())}{u.MJ}
: null }
+ { m.getShieldReinforcement() ? {translate('total')}: {formats.int((m.getAmmo() + 1) * (m.getDuration() * m.getShieldReinforcement()))}{u.MJ}
: null }
{ m.repair ? {translate('repair')}: {m.repair}
: null }
{ m.getFacingLimit() ? {translate('facinglimit')} {formats.f1(m.getFacingLimit())}°
: null }
{ m.getRange() ? {translate('range')} {formats.f2(m.getRange())}{u.km}
: null }
{ m.getRangeT() ? {translate('ranget')} {formats.f1(m.getRangeT())}{u.s}
: null }
- { m.getSpinup() ? {translate('spinup')}: {formats.f1(m.getSpinup())}{u.s}
: null }
{ m.getTime() ? {translate('time')}: {formats.time(m.getTime())}
: null }
{ m.maximum ? {translate('max')}: {(m.maximum)}
: null }
{ m.rangeLS ? {translate('range')}: {m.rangeLS}{u.Ls}
: null }
diff --git a/src/app/shipyard/Module.js b/src/app/shipyard/Module.js
index 2ea29321..710c1528 100755
--- a/src/app/shipyard/Module.js
+++ b/src/app/shipyard/Module.js
@@ -680,14 +680,6 @@ export default class Module {
return this._getModifiedValue('rebuildsperbay');
}
- /**
- * Get the cells for this module, taking in to account modifications
- * @return {Number} the cells for this module
- */
- getCells() {
- return this._getModifiedValue('cells');
- }
-
/**
* Get the jitter for this module, taking in to account modifications
* @return {Number} the jitter for this module
diff --git a/src/app/shipyard/Ship.js b/src/app/shipyard/Ship.js
index cfa9a1f4..40a80237 100755
--- a/src/app/shipyard/Ship.js
+++ b/src/app/shipyard/Ship.js
@@ -1296,7 +1296,9 @@ export default class Ship {
for (let slot of this.internal) {
if (slot.m && slot.m.grp == 'scb') {
- shieldCells += slot.m.getShieldReinforcement() * slot.m.getCells();
+ // There is currently a bug with Elite where you can have a clip > 1 thanks to engineering but it doesn't do anything,
+ // so we need to hard-code clip to 1
+ shieldCells += slot.m.getShieldReinforcement() * slot.m.getDuration() * (slot.m.getAmmo() + 1);
}
}
diff --git a/src/app/utils/CompanionApiUtils.js b/src/app/utils/CompanionApiUtils.js
index 47a1db01..a3fda30c 100644
--- a/src/app/utils/CompanionApiUtils.js
+++ b/src/app/utils/CompanionApiUtils.js
@@ -427,4 +427,10 @@ function _addModifications(module, modifiers, blueprint, grade) {
if (module.getModValue('rof')) {
module.setModValue('rof', ((1 / (1 + module.getModValue('rof') / 10000)) - 1) * 10000);
}
+
+ // Clip size is rounded up so that the result is a whole number
+ if (module.getModValue('clip')) {
+ const individual = 1 / (module.clip || 1);
+ module.setModValue('clip', Math.ceil((module.getModValue('clip') / 10000) / individual) * individual * 10000);
+ }
}