# HG changeset patch # User Darkvater # Date 1116153653 0 # Node ID 81a2b0bd33eaeeb10e4889074eeacd3affb06ec0 # Parent a4b17980b9e43e0e55075992dfdc46c890849a79 (svn r2318) - Feature: added console command 'part' to leave a currently running game and 'join' which is an alias to 'connect' to join a multiplayer server. diff -r a4b17980b9e4 -r 81a2b0bd33ea console_cmds.c --- a/console_cmds.c Sun May 15 10:23:42 2005 +0000 +++ b/console_cmds.c Sun May 15 10:40:53 2005 +0000 @@ -843,6 +843,19 @@ return true; } +DEF_CONSOLE_CMD(ConPart) +{ + if (argc == 0) { + IConsoleHelp("Leave the currently joined/running game (only ingame). Usage: 'part'"); + return true; + } + + if (_game_mode != GM_NORMAL) return false; + + _switch_mode = SM_MENU; + return true; +} + DEF_CONSOLE_CMD(ConHelp) { if (argc == 2) { @@ -1184,6 +1197,7 @@ IConsoleCmdRegister("echoc", ConEchoC); IConsoleCmdRegister("exec", ConExec); IConsoleCmdRegister("exit", ConExit); + IConsoleCmdRegister("part", ConPart); IConsoleCmdRegister("help", ConHelp); IConsoleCmdRegister("info_cmd", ConInfoCmd); IConsoleCmdRegister("info_var", ConInfoVar); @@ -1227,6 +1241,7 @@ IConsoleCmdHookAdd("reset_company", ICONSOLE_HOOK_ACCESS, ConHookServerOnly); IConsoleAliasRegister("clean_company", "reset_company %A"); IConsoleCmdRegister("connect", ConNetworkConnect); + IConsoleAliasRegister("join", "connect %A"); IConsoleCmdHookAdd("connect", ICONSOLE_HOOK_ACCESS, ConHookClientOnly); IConsoleCmdRegister("clients", ConNetworkClients); IConsoleCmdHookAdd("clients", ICONSOLE_HOOK_ACCESS, ConHookNeedNetwork);