From e18a0f03f7b3c2c8f3301a54d83db2802e039ded Mon Sep 17 00:00:00 2001 From: Anson Biggs Date: Thu, 16 Sep 2021 05:05:10 +0000 Subject: [PATCH] fixed issue where while loop didnt work on linux --- include/sim.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/sim.h b/include/sim.h index 9e62c4a..6d864bd 100644 --- a/include/sim.h +++ b/include/sim.h @@ -19,7 +19,7 @@ bool sim(struct Vehicle &State, struct Vehicle &PrevState) { // defining a few random values here cause I'm lazy State.burnElapsed = 2000; State.mass = State.massInitial; - PrevState.thrust = 0; + PrevState.thrust = 0.0; burnStartTimeCalc(State); @@ -52,7 +52,7 @@ bool sim(struct Vehicle &State, struct Vehicle &PrevState) { vehicleDynamics(State, PrevState, t); write2CSV(State, outfile, t); t++; - } while ((State.z > 0) && (State.thrust != 0)); + } while ((State.z > 0.0) || (State.thrust > 1.0)); outfile.close(); @@ -399,4 +399,4 @@ double derivative(double x2, double x1, double dt) { double integral(double x, double y, double dt) { double integ = (x * dt / 1000) + y; return integ; -} \ No newline at end of file +}