diff --git a/src/lib/shipDux/propulsion/drive.js b/src/lib/shipDux/propulsion/drive.js index f165e7d..c6fbb48 100644 --- a/src/lib/shipDux/propulsion/drive.js +++ b/src/lib/shipDux/propulsion/drive.js @@ -7,7 +7,7 @@ import reqs from "../reqs.js"; const dux = new Updux({ subduxes: { reqs }, initial: { - rating: 1, + rating: 0, advanced: false, }, actions: { @@ -20,7 +20,7 @@ dux.setMutation("setDrive", (changes) => u(changes)); dux.setMutation("setDriveReqs", (reqs) => u({ reqs })); // needs to be at the top level -export const calculateDriveReqs = store => +export const calculateDriveReqs = (store) => createSelector( [ (ship) => ship.reqs.mass, @@ -29,7 +29,7 @@ export const calculateDriveReqs = store => ], (ship_mass, rating, advanced) => store.dispatch.setDriveReqs(calcDriveReqs(ship_mass, rating, advanced)) - ); + ); export function calcDriveReqs(shipMass, rating, advanced = false) { const mass = Math.ceil(rating * 0.05 * shipMass);