diff options
author | dominik <dominik@openttd.org> | 2004-12-13 22:13:02 +0000 |
---|---|---|
committer | dominik <dominik@openttd.org> | 2004-12-13 22:13:02 +0000 |
commit | a9972399c52f0d91f089ba3ab928edf9442fd10f (patch) | |
tree | df6851231a3a11c8edcb40e9a5f23e0d49268d46 /console_cmds.c | |
parent | 77e882c3bd01976039b01c1c662f2e61fc10f132 (diff) | |
download | openttd-a9972399c52f0d91f089ba3ab928edf9442fd10f.tar.xz |
(svn r1077) Implements scripts/autoexec.scr to get executed on game starting (sign_de)
- %! allows to merge alias parameters
- \% allows to use % in alias strings
- "alias" command now overwrites the old alias list entry
Diffstat (limited to 'console_cmds.c')
-rw-r--r-- | console_cmds.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/console_cmds.c b/console_cmds.c index 3e2dcb07f..7aaf3999c 100644 --- a/console_cmds.c +++ b/console_cmds.c @@ -367,8 +367,17 @@ DEF_CONSOLE_CMD(ConPrintFC) DEF_CONSOLE_CMD(ConAlias) { + _iconsole_alias* alias; + if (argc < 3) return NULL; - IConsoleAliasRegister(argv[1],argv[2]); + + alias = IConsoleAliasGet(argv[1]); + if (alias == NULL) { + IConsoleAliasRegister(argv[1],argv[2]); + } else { + free(alias->cmdline); + alias->cmdline = strdup(argv[2]); + } return NULL; } |