Fix PD/boost calculation

This commit is contained in:
Cmdr McDonald
2017-03-02 14:37:03 +00:00
parent d4b384eded
commit 5937843be8
4 changed files with 4 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
#2.3.0 #2.3.0
* Add 2.3 diminishing returns on shield value * Add 2.3 diminishing returns on shield value
* Make scan time visible on scanners where available * Make scan time visible on scanners where available
* Update power distributor able-to-boost calculation to take fractional MJ values in to account
#2.2.19 #2.2.19
* Power management panel now displays modules in descending order of power usage by default * Power management panel now displays modules in descending order of power usage by default

View File

@@ -170,7 +170,7 @@ export default class StandardSlotSection extends SlotSection {
selected={currentMenu == st[4]} selected={currentMenu == st[4]}
onChange={this.props.onChange} onChange={this.props.onChange}
ship={ship} ship={ship}
warning={m => m instanceof Module ? m.getEnginesCapacity() < ship.boostEnergy : m.engcap < ship.boostEnergy} warning={m => m instanceof Module ? m.getEnginesCapacity() <= ship.boostEnergy : m.engcap <= ship.boostEnergy}
/>; />;
slots[6] = <StandardSlot slots[6] = <StandardSlot

View File

@@ -126,7 +126,7 @@ export default class ModuleSet {
let pd = this.standard[4][0]; let pd = this.standard[4][0];
for (let p of this.standard[4]) { for (let p of this.standard[4]) {
if (p.mass < pd.mass && p.engcap >= boostEnergy) { if (p.mass < pd.mass && p.engcap > boostEnergy) {
pd = p; pd = p;
} }
} }

View File

@@ -135,7 +135,7 @@ export default class Ship {
*/ */
canBoost() { canBoost() {
return this.canThrust() && // Thrusters operational return this.canThrust() && // Thrusters operational
this.boostEnergy <= this.standard[4].m.getEnginesCapacity(); // PD capacitor is sufficient for boost this.standard[4].m.getEnginesCapacity() > this.boostEnergy; // PD capacitor is sufficient for boost
} }
/** /**