diff --git a/Missions/ProjectApollo/Apollo 1301.cfg b/Missions/ProjectApollo/Apollo 1301.cfg index 7342c17261..0d77ff36a9 100644 --- a/Missions/ProjectApollo/Apollo 1301.cfg +++ b/Missions/ProjectApollo/Apollo 1301.cfg @@ -1,4 +1,5 @@ Name=Apollo 13 +Apollo13Failures=TRUE SMJCVersion=2 CMCVersion=Manche72R3 LGCVersion=LM131R1 diff --git a/Orbitersdk/samples/ProjectApollo/src_aux/Mission.cpp b/Orbitersdk/samples/ProjectApollo/src_aux/Mission.cpp index 27d8427311..0aeeb8c4fc 100644 --- a/Orbitersdk/samples/ProjectApollo/src_aux/Mission.cpp +++ b/Orbitersdk/samples/ProjectApollo/src_aux/Mission.cpp @@ -123,6 +123,7 @@ namespace mission { bCrossPointerShades = false; iLMNumber = 5; //LM-5 bLMEventTimerReverseAtZero = false; + bApollo13Failures = false; strCDRName = "CDR"; strCMPName = "CMP"; strLMPName = "LMP"; @@ -291,6 +292,10 @@ namespace mission { strncpy(buffer, line + 26, 255); bLMEventTimerReverseAtZero = !_strnicmp(buffer, "TRUE", 4); } + else if (!_strnicmp(line, "Apollo13Failures=", 17)) { + strncpy(buffer, line + 17, 255); + bApollo13Failures = !_strnicmp(buffer, "TRUE", 4); + } else if (!_strnicmp(line, "CDRVesselName=", 14)) { strncpy(buffer, line + 14, 255); strCDRName.assign(buffer); @@ -690,4 +695,9 @@ namespace mission { { return bLMEventTimerReverseAtZero; } + + bool Mission::DoApollo13Failures() const + { + return bApollo13Failures; + } } \ No newline at end of file diff --git a/Orbitersdk/samples/ProjectApollo/src_aux/Mission.h b/Orbitersdk/samples/ProjectApollo/src_aux/Mission.h index f46a019aec..c4a894a4c7 100644 --- a/Orbitersdk/samples/ProjectApollo/src_aux/Mission.h +++ b/Orbitersdk/samples/ProjectApollo/src_aux/Mission.h @@ -125,6 +125,8 @@ namespace mission virtual const std::string& GetLMPSuitName() const; //false = LM event timer continues to count down through zero, true = when reaching zero it starts counting up virtual bool IsLMEventTimerReversingAtZero() const; + //Run special Apollo 13 failure and audio code + virtual bool DoApollo13Failures() const; protected: bool GetCueCards(const std::vector &cue, unsigned &counter, unsigned &loc, std::string &meshname, VECTOR3 &ofs); @@ -175,6 +177,7 @@ namespace mission double dTEPHEM0; int iLMNumber; bool bLMEventTimerReverseAtZero; + bool bApollo13Failures; MATRIX3 CM_IMUDriftRates; VECTOR3 CM_PIPABias; diff --git a/Orbitersdk/samples/ProjectApollo/src_csm/satswitches.cpp b/Orbitersdk/samples/ProjectApollo/src_csm/satswitches.cpp index e3deadd7d3..64f93963eb 100644 --- a/Orbitersdk/samples/ProjectApollo/src_csm/satswitches.cpp +++ b/Orbitersdk/samples/ProjectApollo/src_csm/satswitches.cpp @@ -40,6 +40,7 @@ #include "ioChannels.h" #include "saturn.h" +#include "Mission.h" #include "CM_VC_Resource.h" @@ -223,7 +224,7 @@ void SaturnCryoQuantityMeter::DoDrawSwitch(double v, SURFHANDLE drawSurface) #define O2FAILURETIME (46.0 * 3600.0 + 45.0 * 60.0) - if (Sat->GetApolloNo() == 1301) { + if (Sat->GetMission()->DoApollo13Failures()) { if (Sat->GetMissionTime() >= (O2FAILURETIME + 5.0)) { v = 1.05; } diff --git a/Orbitersdk/samples/ProjectApollo/src_csm/saturn.cpp b/Orbitersdk/samples/ProjectApollo/src_csm/saturn.cpp index 33db7d18d4..12e3fe9feb 100644 --- a/Orbitersdk/samples/ProjectApollo/src_csm/saturn.cpp +++ b/Orbitersdk/samples/ProjectApollo/src_csm/saturn.cpp @@ -1348,7 +1348,7 @@ void Saturn::clbkPostCreation() // Load Apollo-13 specific sounds. // - if (ApolloNo == 1301) { + if (pMission->DoApollo13Failures()) { if (!KranzPlayed) soundlib.LoadMissionSound(SKranz, A13_KRANZ, NULL, INTERNAL_ONLY); if (!CryoStir) @@ -1749,7 +1749,7 @@ void Saturn::clbkSaveState(FILEHANDLE scn) if (AutoSlow) { oapiWriteScenario_int (scn, "AUTOSLOW", 1); } - if (ApolloNo == 1301) { + if (pMission->DoApollo13Failures()) { oapiWriteScenario_int (scn, "A13STATE", GetA13State()); } if (SIVBPayload != PAYLOAD_LEM) { @@ -4550,7 +4550,7 @@ void Saturn::LoadDefaultSounds() void Saturn::StageSix(double simt){ UpdateMassAndCoG(); - if (ApolloNo == 1301) { + if (pMission->DoApollo13Failures()) { // // Play cryo-stir audio. diff --git a/Orbitersdk/samples/ProjectApollo/src_csm/saturn.h b/Orbitersdk/samples/ProjectApollo/src_csm/saturn.h index 2d9040c280..4c558be7e2 100644 --- a/Orbitersdk/samples/ProjectApollo/src_csm/saturn.h +++ b/Orbitersdk/samples/ProjectApollo/src_csm/saturn.h @@ -1281,6 +1281,7 @@ class Saturn: public ProjectApolloConnectorVessel, public PanelSwitchListener { virtual SIBSystems *GetSIB() { return NULL; } virtual SICSystems *GetSIC() { return NULL; } SECS *GetSECS() { return &secs; } + mission::Mission *GetMission() { return pMission; } void ClearMeshes();