Browse Source

Change Command feature to report bad command name

Before command feature did not report anything when user has entered a
command name that doesn't exist. This commit fixes that issue.
pull/8/head
Anton Tarasenko 2 years ago
parent
commit
1f3a047dd1
  1. 8
      sources/Commands/Commands_Feature.uc

8
sources/Commands/Commands_Feature.uc

@ -338,6 +338,14 @@ public final function HandleInput(Parser parser, EPlayer callerPlayer)
parser.MUntilMany(commandName, commandDelimiters, true, true); parser.MUntilMany(commandName, commandDelimiters, true, true);
commandInstance = GetCommand(commandName); commandInstance = GetCommand(commandName);
if ( commandInstance == none
&& callerPlayer != none && callerPlayer.IsExistent())
{
callerPlayer
.BorrowConsole()
.Flush()
.Say(F("{$TextFailure Command not found!}"));
}
commandName.FreeSelf(); commandName.FreeSelf();
if (parser.Ok() && commandInstance != none) if (parser.Ok() && commandInstance != none)
{ {

Loading…
Cancel
Save