mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-17 18:40:02 +00:00
engine: server: sv_init: compiling error fix & minor cleanup
This commit is contained in:
parent
a03019f5e4
commit
eac8c116a8
@ -278,7 +278,7 @@ model_t *SV_ModelHandle( int modelindex )
|
|||||||
|
|
||||||
static resourcetype_t SV_DetermineResourceType( const char *filename )
|
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;
|
return t_sound;
|
||||||
else
|
else
|
||||||
return t_generic;
|
return t_generic;
|
||||||
@ -289,6 +289,7 @@ void SV_ReadResourceList( const char *filename )
|
|||||||
string token;
|
string token;
|
||||||
byte *afile;
|
byte *afile;
|
||||||
char *pfile;
|
char *pfile;
|
||||||
|
resourcetype_t restype;
|
||||||
|
|
||||||
afile = FS_LoadFile( filename, NULL, false );
|
afile = FS_LoadFile( filename, NULL, false );
|
||||||
if( !afile ) return;
|
if( !afile ) return;
|
||||||
@ -304,7 +305,7 @@ void SV_ReadResourceList( const char *filename )
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
COM_FixSlashes( token );
|
COM_FixSlashes( token );
|
||||||
resourcetype_t restype = SV_DetermineResourceType( token );
|
restype = SV_DetermineResourceType( token );
|
||||||
Con_DPrintf( " %s (%s)\n", token, COM_GetResourceTypeName( restype ));
|
Con_DPrintf( " %s (%s)\n", token, COM_GetResourceTypeName( restype ));
|
||||||
switch( restype )
|
switch( restype )
|
||||||
{
|
{
|
||||||
@ -312,7 +313,7 @@ void SV_ReadResourceList( const char *filename )
|
|||||||
case t_sound:
|
case t_sound:
|
||||||
{
|
{
|
||||||
const char *filepath = token;
|
const char *filepath = token;
|
||||||
filepath += 6; // skip "sound/" part
|
filepath += sizeof( DEFAULT_SOUNDPATH ) - 1; // skip "sound/" part
|
||||||
SV_SoundIndex( filepath );
|
SV_SoundIndex( filepath );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user