make sv_new a little friendlier

This commit is contained in:
Bill Currie 2005-05-05 13:53:47 +00:00
parent ac96f94658
commit 6c6f78158e

View file

@ -786,16 +786,17 @@ sv_new_f (void)
server_t *sv; server_t *sv;
netadr_t adr; netadr_t adr;
if (Cmd_Argc () != 3) { if (Cmd_Argc () < 2 || Cmd_Argc () > 3) {
qtv_printf ("Usage: sv_new <name> <address>\n"); qtv_printf ("Usage: sv_new <name> <address>\n");
return; return;
} }
name = Cmd_Argv (1); address = name = Cmd_Argv (1);
if (Hash_Find (server_hash, name)) { if (Hash_Find (server_hash, name)) {
qtv_printf ("sv_new: %s already exists\n", name); qtv_printf ("sv_new: %s already exists\n", name);
return; return;
} }
address = Cmd_Argv (2); if (Cmd_Argc () == 3)
address = Cmd_Argv (2);
if (!NET_StringToAdr (address, &adr)) { if (!NET_StringToAdr (address, &adr)) {
qtv_printf ("Bad server address\n"); qtv_printf ("Bad server address\n");
return; return;