summaryrefslogtreecommitdiff
path: root/console_cmds.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-09-14 23:26:58 +0000
committerDarkvater <darkvater@openttd.org>2006-09-14 23:26:58 +0000
commitdc93d63478d41e913bf86ca4ff84e37bf381c9f8 (patch)
tree986f5c07418dce4d799bc3ee9135d38693876a07 /console_cmds.c
parent2d329463bf7b3d0146a64d19207721756837d924 (diff)
downloadopenttd-dc93d63478d41e913bf86ca4ff84e37bf381c9f8.tar.xz
(svn r6450) -Feature: Make the 'patch' console command available for offline use and for
online use for player-based settings.
Diffstat (limited to 'console_cmds.c')
-rw-r--r--console_cmds.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/console_cmds.c b/console_cmds.c
index 5543ccb8d..8a44054e3 100644
--- a/console_cmds.c
+++ b/console_cmds.c
@@ -1373,7 +1373,12 @@ DEF_CONSOLE_CMD(ConPatch)
IConsoleGetPatchSetting(argv[1]);
} else {
uint32 val;
- if (GetArgumentInteger(&val, argv[2])) IConsoleSetPatchSetting(argv[1], val);
+
+ if (GetArgumentInteger(&val, argv[2])) {
+ if (!IConsoleSetPatchSetting(argv[1], val)) {
+ IConsoleError("This command/variable is only available to a network server.");
+ }
+ }
}
return true;
@@ -1459,6 +1464,7 @@ void IConsoleStdLibRegister(void)
IConsoleCmdRegister("cd", ConChangeDirectory);
IConsoleCmdRegister("pwd", ConPrintWorkingDirectory);
IConsoleCmdRegister("clear", ConClearBuffer);
+ IConsoleCmdRegister("patch", ConPatch);
IConsoleAliasRegister("dir", "ls");
IConsoleAliasRegister("del", "rm %+");
@@ -1514,8 +1520,6 @@ void IConsoleStdLibRegister(void)
IConsoleCmdRegister("unpause", ConUnPauseGame);
IConsoleCmdHookAdd("unpause", ICONSOLE_HOOK_ACCESS, ConHookServerOnly);
- IConsoleCmdRegister("patch", ConPatch);
-
/*** Networking variables ***/
IConsoleVarRegister("net_frame_freq", &_network_frame_freq, ICONSOLE_VAR_BYTE, "The amount of frames before a command will be (visibly) executed. Default value: 1");
IConsoleVarHookAdd("net_frame_freq", ICONSOLE_HOOK_ACCESS, ConHookServerOnly);