mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
engine: client: always load client.dll last to crash on nullptr in mods that fetch cvar pointers early, add comment for anyone who would modify this file
This commit is contained in:
@@ -3723,15 +3723,16 @@ void CL_Init( void )
|
||||
|
||||
COM_GetCommonLibraryPath( LIBRARY_CLIENT, libpath, sizeof( libpath ));
|
||||
|
||||
if( !CL_LoadProgs( libpath ))
|
||||
Host_Error( "can't initialize %s: %s\n", libpath, COM_GetLibraryError( ));
|
||||
|
||||
S_Init(); // init sound
|
||||
Voice_Init( VOICE_DEFAULT_CODEC, 3, true ); // init voice (do not open the device)
|
||||
|
||||
ID_Init();
|
||||
SteamBroker_Init();
|
||||
|
||||
// client must be always initialized last so it can fetch all cvars
|
||||
if( !CL_LoadProgs( libpath ))
|
||||
Host_Error( "can't initialize %s: %s\n", libpath, COM_GetLibraryError( ));
|
||||
|
||||
cls.build_num = 0;
|
||||
cls.initialized = true;
|
||||
cl.maxclients = 1; // allow to drawing player in menu
|
||||
|
||||
@@ -4132,6 +4132,7 @@ qboolean CL_LoadProgs( const char *name )
|
||||
clgame.dllFuncs.pfnInit();
|
||||
|
||||
CL_InitStudioAPI();
|
||||
S_InitSoundAPI();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -99,6 +99,7 @@ void SX_RoomFX( portable_samplepair_t *paint, int num_samples );
|
||||
void SX_ClearState( void );
|
||||
|
||||
qboolean S_Init( void );
|
||||
qboolean S_InitSoundAPI( void );
|
||||
void S_Shutdown( void );
|
||||
void S_SoundList_f( void );
|
||||
void S_SoundInfo_f( void );
|
||||
|
||||
@@ -1948,7 +1948,7 @@ static const sound_api_t gSoundAPI = {
|
||||
S_InitSoundAPI
|
||||
================
|
||||
*/
|
||||
static qboolean S_InitSoundAPI( void )
|
||||
qboolean S_InitSoundAPI( void )
|
||||
{
|
||||
// make sure what sound functions is cleared
|
||||
memset( &clgame.soundFuncs, 0, sizeof( clgame.soundFuncs ));
|
||||
@@ -1967,6 +1967,9 @@ static qboolean S_InitSoundAPI( void )
|
||||
memset( &clgame.soundFuncs, 0, sizeof( clgame.soundFuncs ));
|
||||
}
|
||||
|
||||
if( clgame.soundFuncs.pfnS_Init )
|
||||
clgame.soundFuncs.pfnS_Init( &snd );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2030,17 +2033,15 @@ qboolean S_Init( void )
|
||||
S_InitSounds ();
|
||||
VOX_Init ();
|
||||
|
||||
S_InitSoundAPI();
|
||||
|
||||
if( clgame.soundFuncs.pfnS_Init )
|
||||
clgame.soundFuncs.pfnS_Init( &snd );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// Shutdown sound engine
|
||||
// =======================================================================
|
||||
/*
|
||||
============
|
||||
S_Shutdown
|
||||
|
||||
============
|
||||
*/
|
||||
void S_Shutdown( void )
|
||||
{
|
||||
if( !snd.initialized ) return;
|
||||
|
||||
Reference in New Issue
Block a user