MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / SetSimulationMode

Method SetSimulationMode

Editor/GameEngine.cpp:650–681  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

648
649//////////////////////////////////////////////////////////////////////////
650void CGameEngine::SetSimulationMode( bool enabled )
651{
652 if (m_simulationMode == enabled)
653 return;
654 m_simulationMode = enabled;
655
656 if (m_simulationMode)
657 {
658 // When turning physics on, emulate out of game event.
659 m_ISystem->GetAISystem()->Reset();
660 // [Anton] the order of the next 3 calls changed, since, EVENT_INGAME loads physics state (if any),
661 // and Reset should be called before it
662 m_ISystem->GetIPhysicalWorld()->ResetDynamicEntities();
663 if (m_IGame)
664 m_IGame->ResetState();
665 GetIEditor()->GetObjectManager()->SendEvent( EVENT_INGAME );
666 GetIEditor()->SetConsoleVar( "ai_ignoreplayer",1 );
667 GetIEditor()->SetConsoleVar( "ai_soundperception",0 );
668 }
669 else
670 {
671 // When turning physics off, emulate out of game event.
672 m_ISystem->GetAISystem()->Reset();
673 m_ISystem->GetIPhysicalWorld()->ResetDynamicEntities();
674 if (m_IGame)
675 m_IGame->ResetState();
676 GetIEditor()->GetObjectManager()->SendEvent( EVENT_OUTOFGAME );
677 GetIEditor()->SetConsoleVar( "ai_ignoreplayer",0 );
678 GetIEditor()->SetConsoleVar( "ai_soundperception",1 );
679
680 }
681}
682
683//////////////////////////////////////////////////////////////////////////
684void CGameEngine::GenerateAiTriangulation()

Callers 2

SetAutoRecordingMethod · 0.80
OnSwitchPhysicsMethod · 0.80

Calls 9

GetIEditorFunction · 0.85
ResetDynamicEntitiesMethod · 0.80
GetIPhysicalWorldMethod · 0.80
ResetStateMethod · 0.80
ResetMethod · 0.45
GetAISystemMethod · 0.45
SendEventMethod · 0.45
GetObjectManagerMethod · 0.45
SetConsoleVarMethod · 0.45

Tested by

no test coverage detected