Ignore chat triggers for interactive ban reason (#2067)
* Ignore chat triggers for interactive ban reason If the admin types a chat trigger for a command while BaseBans is waiting for them to type a ban reason, don't treat that message as the ban reason. This fixes a problem where the admin decides to cancel their ban with "!abortban", "/abortban" etc, but ends up accidentally banning the player with the ban reason "!abortban" (or by attempting to access any other command via a chat trigger before typing the ban reason). * Optimize Check if we're actually waiting for chat reason before calling the native
This commit is contained in:
parent
2c6ef5825f
commit
8938a29904
@ -384,7 +384,7 @@ public Action Command_AbortBan(int client, int args)
|
|||||||
|
|
||||||
public Action OnClientSayCommand(int client, const char[] command, const char[] sArgs)
|
public Action OnClientSayCommand(int client, const char[] command, const char[] sArgs)
|
||||||
{
|
{
|
||||||
if(playerinfo[client].isWaitingForChatReason)
|
if(playerinfo[client].isWaitingForChatReason && !IsChatTrigger())
|
||||||
{
|
{
|
||||||
playerinfo[client].isWaitingForChatReason = false;
|
playerinfo[client].isWaitingForChatReason = false;
|
||||||
PrepareBan(client, playerinfo[client].banTarget, playerinfo[client].banTime, sArgs);
|
PrepareBan(client, playerinfo[client].banTarget, playerinfo[client].banTime, sArgs);
|
||||||
|
Loading…
Reference in New Issue
Block a user