mirror of
https://github.com/UberGames/ioef.git
synced 2025-02-16 08:51:20 +00:00
Improve "play" command, based on a patch from Ensiform.
This commit is contained in:
parent
98f04d39a6
commit
d9bea4977b
1 changed files with 11 additions and 5 deletions
|
@ -400,22 +400,28 @@ S_Play_f
|
||||||
*/
|
*/
|
||||||
void S_Play_f( void ) {
|
void S_Play_f( void ) {
|
||||||
int i;
|
int i;
|
||||||
|
int c;
|
||||||
sfxHandle_t h;
|
sfxHandle_t h;
|
||||||
char name[256];
|
char name[MAX_TOKEN_CHARS];
|
||||||
|
|
||||||
if( !si.RegisterSound || !si.StartLocalSound ) {
|
if( !si.RegisterSound || !si.StartLocalSound ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
i = 1;
|
c = Cmd_Argc();
|
||||||
while ( i<Cmd_Argc() ) {
|
|
||||||
|
if( c < 2 ) {
|
||||||
|
Com_Printf ("Usage: play <sound filename> [sound filename] [sound filename] ...\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for( i = 1; i < c; i++ ) {
|
||||||
Q_strncpyz( name, Cmd_Argv(i), sizeof(name) );
|
Q_strncpyz( name, Cmd_Argv(i), sizeof(name) );
|
||||||
h = si.RegisterSound( name, qfalse );
|
h = si.RegisterSound( name, qfalse );
|
||||||
|
|
||||||
if( h ) {
|
if( h ) {
|
||||||
si.StartLocalSound( h, CHAN_LOCAL_SOUND );
|
si.StartLocalSound( h, CHAN_LOCAL_SOUND );
|
||||||
}
|
}
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -438,7 +444,7 @@ void S_Music_f( void ) {
|
||||||
} else if ( c == 3 ) {
|
} else if ( c == 3 ) {
|
||||||
si.StartBackgroundTrack( Cmd_Argv(1), Cmd_Argv(2) );
|
si.StartBackgroundTrack( Cmd_Argv(1), Cmd_Argv(2) );
|
||||||
} else {
|
} else {
|
||||||
Com_Printf ("music <musicfile> [loopfile]\n");
|
Com_Printf ("Usage: music <musicfile> [loopfile]\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue