mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r19512) -Fix (r19511): using the 'alias' console command it's possible to create a duplicate alias name
This commit is contained in:
parent
f4a107dae5
commit
37a37c191d
|
@ -261,6 +261,11 @@ IConsoleCmd *IConsoleCmdGet(const char *name)
|
|||
*/
|
||||
void IConsoleAliasRegister(const char *name, const char *cmd)
|
||||
{
|
||||
if (IConsoleAliasGet(name) != NULL) {
|
||||
IConsoleError("an alias with this name already exists; insertion aborted");
|
||||
return;
|
||||
}
|
||||
|
||||
char *new_alias = strdup(name);
|
||||
char *cmd_aliased = strdup(cmd);
|
||||
IConsoleAlias *item_new = MallocT<IConsoleAlias>(1);
|
||||
|
|
Loading…
Reference in New Issue