Browse Source

engine: server: sv_init: compiling error fix & minor cleanup

pull/2/head
SNMetamorph 2 years ago committed by Alibek Omarov
parent
commit
eac8c116a8
  1. 7
      engine/server/sv_init.c

7
engine/server/sv_init.c

@ -278,7 +278,7 @@ model_t *SV_ModelHandle( int modelindex ) @@ -278,7 +278,7 @@ model_t *SV_ModelHandle( int modelindex )
static resourcetype_t SV_DetermineResourceType( const char *filename )
{
if( !Q_strncmp( filename, "sound/", 6 ) && Sound_SupportedFileFormat( COM_FileExtension( filename )))
if( !Q_strncmp( filename, DEFAULT_SOUNDPATH, sizeof( DEFAULT_SOUNDPATH ) - 1 ) && Sound_SupportedFileFormat( COM_FileExtension( filename )))
return t_sound;
else
return t_generic;
@ -289,6 +289,7 @@ void SV_ReadResourceList( const char *filename ) @@ -289,6 +289,7 @@ void SV_ReadResourceList( const char *filename )
string token;
byte *afile;
char *pfile;
resourcetype_t restype;
afile = FS_LoadFile( filename, NULL, false );
if( !afile ) return;
@ -304,7 +305,7 @@ void SV_ReadResourceList( const char *filename ) @@ -304,7 +305,7 @@ void SV_ReadResourceList( const char *filename )
continue;
COM_FixSlashes( token );
resourcetype_t restype = SV_DetermineResourceType( token );
restype = SV_DetermineResourceType( token );
Con_DPrintf( " %s (%s)\n", token, COM_GetResourceTypeName( restype ));
switch( restype )
{
@ -312,7 +313,7 @@ void SV_ReadResourceList( const char *filename ) @@ -312,7 +313,7 @@ void SV_ReadResourceList( const char *filename )
case t_sound:
{
const char *filepath = token;
filepath += 6; // skip "sound/" part
filepath += sizeof( DEFAULT_SOUNDPATH ) - 1; // skip "sound/" part
SV_SoundIndex( filepath );
break;
}

Loading…
Cancel
Save