示例#1
0
qboolean G_ClientRunThreadCmd( const gentity_t *ent )
{
	str		threadName;
	CThread	*thread;
	
	Q_UNUSED(ent);

	// Get the thread name
	
	if ( !gi.argc() )
		return true;
	
	threadName = gi.argv( 1 );
	
	
	// Check to make sure player is allowed to run this thread
	
	// Need to do this part
	
	// Run the thread
	
	if ( !threadName.length() )
		return true;
	
	thread = Director.CreateThread( threadName );
	
	if ( thread )
		thread->DelayedStart( 0.0f );
	
	return true;
}
示例#2
0
/*
==============
Start

Does all post-spawning setup.  This is NOT called for savegames.
==============
*/
void Level::Start( void )
{
	CThread *gamescript;

	// initialize secrets

	levelVars.SetVariable( "total_secrets", total_secrets );
	levelVars.SetVariable( "found_secrets", found_secrets );
	levelVars.SetVariable( "total_specialItems" , total_specialItems );
	levelVars.SetVariable( "found_specialItems" , found_specialItems );
	levelVars.SetVariable( "total_enemies_spawned", _totalEnemiesSpawned );
	

	FindTeams();

	// call the precache scripts
	
	Precache();

	// start executing the game script

	if ( game_script.length() )
	{
		gi.ProcessLoadingScreen( "$$LoadingScript$$" );

		program.Load( game_script );

		gi.ProcessLoadingScreen( "$$DoneLoadingScript$$" );

		// Create the main thread

		gamescript = Director.CreateThread( "main" );

		if ( gamescript )
		{
			// Run the precache thread if it exists

			if ( gamescript->labelExists( "precache" ) )
			{
				CThread *precache_script;
				precache_script = Director.CreateThread( "precache" );

				if ( precache_script )
					precache_script->DelayedStart( 0.0f );
			}

			// Run the main thread

			gamescript->DelayedStart( 0.0f );
		}
	}

	loadLevelStrings();
	started = true;
}