Esempio n. 1
0
bool GT_asLoadScript( const char *gametypeName ) {
	const char *moduleName = GAMETYPE_SCRIPTS_MODULE_NAME;
	asIScriptModule *asModule;

	GT_ResetScriptData();

	// Load the script
	asModule = G_LoadGameScript( moduleName, GAMETYPE_SCRIPTS_DIRECTORY, gametypeName, GAMETYPE_PROJECT_EXTENSION );
	if( asModule == NULL ) {
		return false;
	}

	// Initialize the script
	if( !G_asInitializeGametypeScript( asModule ) ) {
		GT_asShutdownScript();
		return false;
	}

	return true;
}
Esempio n. 2
0
/*
* G_asLoadMapScript
*/
bool G_asLoadMapScript( const char *mapName )
{
	const char *moduleName = MAP_SCRIPTS_MODULE_NAME;
	asIScriptModule *asModule;

	G_ResetMapScriptData();

	// Load the script
	asModule = G_LoadGameScript( moduleName, MAP_SCRIPTS_DIRECTORY, mapName, MAP_SCRIPTS_PROJECT_EXTENSION );
	if( !asModule ) {
		return false;
	}

	// Initialize the script
	if( !G_asInitializeMapScript( asModule ) ) {
		G_asShutdownMapScript();
		return false;
	}

	return true;
}