-void Eclass_Init ()
-{
- GSList *pFiles;
-
- // start by creating the default unknown eclass
- eclass_bad = EClass_Create("UNKNOWN_CLASS" , 0, 0.5, 0,NULL,NULL,NULL);
-
- // now scan the definitions
- _EClassTable *pTable = &g_EClassDefTable;
- while (pTable)
- {
- // read in all scripts/*.<extension>
- pFiles = vfsGetFileList("scripts", pTable->m_pfnGetExtension());
- if (pFiles)
- {
- GSList *pFile = pFiles;
- while (pFile)
- {
- /*!
- \todo the MP/SP filtering rules need to be CLEANED UP and SANITIZED
- */
- // HACK
- // JKII SP/MP mapping mode
- if (g_pGameDescription->mGameFile == "jk2.game" || g_pGameDescription->mGameFile == "ja.game")
- {
- if (!strcmp(ValueForKey(g_qeglobals.d_project_entity, "gamemode"), "sp"))
- {
- // SP mapping, ignore mp_*.def
- char *name = (char *)pFile->data;
- if (name[0]=='m' && name[1]=='p' && name[2]=='_')
- {
- Sys_Printf("Single Player mapping mode. Ignoring '%s'\n", name);
- pFile = pFile->next;
- continue;
- }
- }
- else
- {
- // MP mapping, ignore sp_*.def
- char *name = (char *)pFile->data;
- if (name[0]=='s' && name[1]=='p' && name[2]=='_')
- {
- Sys_Printf("Multiplayer mapping mode. Ignoring '%s'\n", name);
- pFile = pFile->next;
- continue;
- }
- }
- }
- // RIANT
- // STVEF SP/MP mapping mode
- else if (g_pGameDescription->mGameFile == "stvef.game")
- {
- if (!strcmp(ValueForKey(g_qeglobals.d_project_entity, "gamemode"), "sp"))
- {
- // SP mapping, ignore mp_*.def
- char *name = (char *)pFile->data;
- if (name[0]=='m' && name[1]=='p' && name[2]=='_')
- {
- Sys_Printf("Single Player mapping mode. Ignoring '%s'\n", name);
- pFile = pFile->next;
- continue;
- }
- }
- else
- {
- // HM mapping, ignore sp_*.def
- char *name = (char *)pFile->data;
- if (name[0]=='h' && name[1]=='m' && name[2]=='_')
- {
- Sys_Printf("HoloMatch mapping mode. Ignoring '%s'\n", name);
- pFile = pFile->next;
- continue;
- }
- }
- }
- // for a given name, we grab the first .def in the vfs
- // this allows to override baseq3/scripts/entities.def for instance
- char relPath[PATH_MAX];
- strcpy(relPath, "scripts/");
- strcat(relPath, (char*)pFile->data);
- char *fullpath = vfsGetFullPath(relPath, 0, 0);
- if (!fullpath)
- {
- Sys_FPrintf(SYS_ERR, "Failed to find the full path for \"%s\" in the VFS\n", relPath);
- }
- else
- pTable->m_pfnScanFile(fullpath);
- if (g_pGameDescription->mEClassSingleLoad)
- break;
- pFile = pFile->next;
- }
- vfsClearFileDirList(&pFiles);
- pFiles = NULL;
- }
- else
- Sys_FPrintf(SYS_ERR, "Didn't find any scripts/*.%s files to load EClass information\n", pTable->m_pfnGetExtension());
-
- // we deal with two formats max, if the other table exists, loop again
- if (g_bHaveEClassExt && pTable == &g_EClassDefTable)
- pTable = &g_EClassExtTable;
- else
- pTable = NULL; // done, exit
- }
- Eclass_CreateSpriteModelPaths();
+void Eclass_Init(){
+ GSList *pFiles;
+
+ // start by creating the default unknown eclass
+ eclass_bad = EClass_Create( "UNKNOWN_CLASS", 0, 0.5, 0,NULL,NULL,NULL );
+
+ // now scan the definitions
+ _EClassTable *pTable = &g_EClassDefTable;
+ while ( pTable )
+ {
+ // read in all scripts/*.<extension>
+ pFiles = vfsGetFileList( "scripts", pTable->m_pfnGetExtension() );
+ if ( pFiles ) {
+ GSList *pFile = pFiles;
+ while ( pFile )
+ {
+ /*!
+ \todo the MP/SP filtering rules need to be CLEANED UP and SANITIZED
+ */
+ // HACK
+ // JKII SP/MP mapping mode
+ if ( g_pGameDescription->mGameFile == "jk2.game" || g_pGameDescription->mGameFile == "ja.game" ) {
+ if ( !strcmp( ValueForKey( g_qeglobals.d_project_entity, "gamemode" ), "sp" ) ) {
+ // SP mapping, ignore mp_*.def
+ char *name = (char *)pFile->data;
+ if ( name[0] == 'm' && name[1] == 'p' && name[2] == '_' ) {
+ Sys_Printf( "Single Player mapping mode. Ignoring '%s'\n", name );
+ pFile = pFile->next;
+ continue;
+ }
+ }
+ else
+ {
+ // MP mapping, ignore sp_*.def
+ char *name = (char *)pFile->data;
+ if ( name[0] == 's' && name[1] == 'p' && name[2] == '_' ) {
+ Sys_Printf( "Multiplayer mapping mode. Ignoring '%s'\n", name );
+ pFile = pFile->next;
+ continue;
+ }
+ }
+ }
+ // RIANT
+ // STVEF SP/MP mapping mode
+ else if ( g_pGameDescription->mGameFile == "stvef.game" ) {
+ if ( !strcmp( ValueForKey( g_qeglobals.d_project_entity, "gamemode" ), "sp" ) ) {
+ // SP mapping, ignore mp_*.def
+ char *name = (char *)pFile->data;
+ if ( name[0] == 'm' && name[1] == 'p' && name[2] == '_' ) {
+ Sys_Printf( "Single Player mapping mode. Ignoring '%s'\n", name );
+ pFile = pFile->next;
+ continue;
+ }
+ }
+ else
+ {
+ // HM mapping, ignore sp_*.def
+ char *name = (char *)pFile->data;
+ if ( name[0] == 'h' && name[1] == 'm' && name[2] == '_' ) {
+ Sys_Printf( "HoloMatch mapping mode. Ignoring '%s'\n", name );
+ pFile = pFile->next;
+ continue;
+ }
+ }
+ }
+ // for a given name, we grab the first .def in the vfs
+ // this allows to override baseq3/scripts/entities.def for instance
+ char relPath[PATH_MAX];
+ strcpy( relPath, "scripts/" );
+ strcat( relPath, (char*)pFile->data );
+ char *fullpath = vfsGetFullPath( relPath, 0, 0 );
+ if ( !fullpath ) {
+ Sys_FPrintf( SYS_ERR, "Failed to find the full path for \"%s\" in the VFS\n", relPath );
+ }
+ else{
+ pTable->m_pfnScanFile( fullpath );
+ }
+ if ( g_pGameDescription->mEClassSingleLoad ) {
+ break;
+ }
+ pFile = pFile->next;
+ }
+ vfsClearFileDirList( &pFiles );
+ pFiles = NULL;
+ }
+ else{
+ Sys_FPrintf( SYS_ERR, "Didn't find any scripts/*.%s files to load EClass information\n", pTable->m_pfnGetExtension() );
+ }
+
+ // we deal with two formats max, if the other table exists, loop again
+ if ( g_bHaveEClassExt && pTable == &g_EClassDefTable ) {
+ pTable = &g_EClassExtTable;
+ }
+ else{
+ pTable = NULL; // done, exit
+ }
+ }
+ Eclass_CreateSpriteModelPaths();