mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
make sv_new a little friendlier
This commit is contained in:
parent
ac96f94658
commit
6c6f78158e
1 changed files with 4 additions and 3 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue