MCPcopy Create free account
hub / github.com/JACoders/OpenJK / RunScript

Method RunScript

code/game/Q3_Interface.cpp:7768–7789  ·  view source on GitHub ↗

Run the script.

Source from the content-addressed store, hash-verified

7766
7767// Run the script.
7768void CQuake3GameInterface::RunScript( const gentity_t *pEntity, const char *strScriptName )
7769{
7770 char *pBuf = NULL;
7771 int iLength = 0;
7772
7773 switch( RegisterScript( strScriptName, (void **) &pBuf, iLength ) )
7774 {
7775 // If could not be loaded, leave!
7776 case SCRIPT_COULDNOTREGISTER:
7777 DebugPrint( WL_WARNING, "RunScript: Script was not found and could not be loaded!!! %s\n", strScriptName);
7778 return;
7779
7780 // We loaded the script and registered it, so run it!
7781 case SCRIPT_REGISTERED:
7782 case SCRIPT_ALREADYREGISTERED:
7783 assert( pBuf );
7784 assert( iLength );
7785 if ( IIcarusInterface::GetIcarus()->Run( pEntity->m_iIcarusID, pBuf, iLength ) != IIcarusInterface::ICARUS_INVALID )
7786 DebugPrint( WL_VERBOSE, "%d Script %s executed by %s %s\n", level.time, (char *) strScriptName, pEntity->classname, pEntity->targetname );
7787 return;
7788 }
7789}
7790
7791void CQuake3GameInterface::Svcmd( void )
7792{

Callers 5

G_RoffNotetrackCallbackFunction · 0.80
scriptrunner_runFunction · 0.80
Svcmd_RunScript_fFunction · 0.80
G_StartCinematicSkipFunction · 0.80
G_ActivateBehaviorFunction · 0.80

Calls 1

RunMethod · 0.45

Tested by

no test coverage detected