@@ -776,39 +776,39 @@ void GameEngine::update( void )
776776 {
777777
778778 // VERIFY CRC needs to be in this code block. Please to not pull TheGameLogic->update() inside this block.
779- VERIFY_CRC
779+ VERIFY_CRC
780780
781- TheRadar->UPDATE ();
781+ TheRadar->UPDATE ();
782782
783- // / @todo Move audio init, update, etc, into GameClient update
784-
785- TheAudio->UPDATE ();
786- TheGameClient->UPDATE ();
787- TheMessageStream->propagateMessages ();
783+ // / @todo Move audio init, update, etc, into GameClient update
788784
789- if (g_bTearDownGeneralsOnlineRequested) // delayed tear down
790- {
791- g_bTearDownGeneralsOnlineRequested = false ;
785+ TheAudio-> UPDATE ();
786+ TheGameClient-> UPDATE ();
787+ TheMessageStream-> propagateMessages () ;
792788
793- if (g_pOnlineServicesMgr != nullptr )
794- {
795- g_pOnlineServicesMgr->Shutdown ();
796- delete g_pOnlineServicesMgr;
797- g_pOnlineServicesMgr = nullptr ;
798- }
789+ if (g_bTearDownGeneralsOnlineRequested) // delayed tear down
790+ {
791+ g_bTearDownGeneralsOnlineRequested = false ;
799792
800- }
801- if (g_pOnlineServicesMgr != nullptr )
802- {
803- g_pOnlineServicesMgr->Tick ();
804- }
793+ if (g_pOnlineServicesMgr != nullptr )
794+ {
795+ g_pOnlineServicesMgr->Shutdown ();
796+ delete g_pOnlineServicesMgr;
797+ g_pOnlineServicesMgr = nullptr ;
798+ }
805799
806- if (TheNetwork != NULL )
807- {
808- TheNetwork->UPDATE ();
809- }
810-
811- TheCDManager->UPDATE ();
800+ }
801+ if (g_pOnlineServicesMgr != nullptr )
802+ {
803+ g_pOnlineServicesMgr->Tick ();
804+ }
805+
806+ if (TheNetwork != NULL )
807+ {
808+ TheNetwork->UPDATE ();
809+ }
810+
811+ TheCDManager->UPDATE ();
812812 }
813813
814814
@@ -817,7 +817,7 @@ void GameEngine::update( void )
817817 TheGameLogic->UPDATE ();
818818 }
819819
820-
820+
821821
822822 } // end perfGather
823823
@@ -828,18 +828,18 @@ extern bool DX8Wrapper_IsWindowed;
828828extern HWND ApplicationHWnd;
829829
830830/* * -----------------------------------------------------------------------------------------------
831- * The "main loop" of the game engine. It will not return until the game exits.
831+ * The "main loop" of the game engine. It will not return until the game exits.
832832 */
833- void GameEngine::execute ( void )
833+ void GameEngine::execute (void )
834834{
835-
835+
836836 DWORD prevTime = timeGetTime ();
837837#if defined(_DEBUG) || defined(_INTERNAL)
838838 DWORD startTime = timeGetTime () / 1000 ;
839839#endif
840840
841841 // pretty basic for now
842- while ( !m_quitting )
842+ while ( !m_quitting)
843843 {
844844
845845 // if (TheGlobalData->m_vTune)
@@ -872,34 +872,46 @@ void GameEngine::execute( void )
872872 }
873873 }
874874#endif
875-
875+
876876 {
877- try
877+ if ( IsDebuggerPresent ())
878878 {
879879 // compute a frame
880880 update ();
881881 }
882- catch (INIException e)
882+ else
883883 {
884- // Release CRASH doesn't return, so don't worry about executing additional code.
885- if (e.mFailureMessage )
886- RELEASE_CRASH ((e.mFailureMessage ));
887- else
888- RELEASE_CRASH ((" Uncaught Exception in GameEngine::update" ));
889- }
890- catch (...)
891- {
892- // try to save info off
893- try
884+ try
894885 {
895- if (TheRecorder && TheRecorder-> getMode () == RECORDERMODETYPE_RECORD && TheRecorder-> isMultiplayer ())
896- TheRecorder-> cleanUpReplayFile ();
886+ // compute a frame
887+ update ();
897888 }
898- catch (... )
889+ catch (INIException e )
899890 {
891+ // Release CRASH doesn't return, so don't worry about executing additional code.
892+ if (e.mFailureMessage )
893+ RELEASE_CRASH ((e.mFailureMessage ));
894+ else
895+ RELEASE_CRASH ((" Uncaught Exception in GameEngine::update" ));
900896 }
901- RELEASE_CRASH ((" Uncaught Exception in GameEngine::update" ));
902- } // catch
897+ catch (...)
898+ {
899+ // try to save info off
900+ try
901+ {
902+ if (TheRecorder && TheRecorder->getMode () == RECORDERMODETYPE_RECORD && TheRecorder->isMultiplayer ())
903+ TheRecorder->cleanUpReplayFile ();
904+ }
905+ catch (const std::exception& e) // caught by reference to base
906+ {
907+ NetworkLog (" A standard exception was caught, with message: %s" , e.what ());
908+ }
909+ catch (...)
910+ {
911+ }
912+ RELEASE_CRASH ((" Uncaught Exception in GameEngine::update" ));
913+ } // catch
914+ }
903915 } // perf
904916
905917 {
0 commit comments