summaryrefslogtreecommitdiff
path: root/source/mvd_client.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/mvd_client.c')
-rw-r--r--source/mvd_client.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/source/mvd_client.c b/source/mvd_client.c
index 806f667..edcb826 100644
--- a/source/mvd_client.c
+++ b/source/mvd_client.c
@@ -806,10 +806,18 @@ mvd_t *MVD_SetChannel( int arg ) {
return NULL;
}
- id = atoi( s );
- LIST_FOR_EACH( mvd_t, mvd, &mvd_channels, entry ) {
- if( mvd->id == id ) {
- return mvd;
+ if( COM_IsNumeric( s ) ) {
+ id = atoi( s );
+ LIST_FOR_EACH( mvd_t, mvd, &mvd_channels, entry ) {
+ if( mvd->id == id ) {
+ return mvd;
+ }
+ }
+ } else {
+ LIST_FOR_EACH( mvd_t, mvd, &mvd_channels, entry ) {
+ if( !strcmp( mvd->name, s ) ) {
+ return mvd;
+ }
}
}