From 8938a299048f4cb92127840edfef61ba2cd76d3e Mon Sep 17 00:00:00 2001 From: Rain Date: Mon, 16 Oct 2023 17:43:00 +0000 Subject: [PATCH] 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 --- plugins/basebans.sp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/basebans.sp b/plugins/basebans.sp index 986afd17..081faab6 100644 --- a/plugins/basebans.sp +++ b/plugins/basebans.sp @@ -384,7 +384,7 @@ public Action Command_AbortBan(int client, int args) public Action OnClientSayCommand(int client, const char[] command, const char[] sArgs) { - if(playerinfo[client].isWaitingForChatReason) + if(playerinfo[client].isWaitingForChatReason && !IsChatTrigger()) { playerinfo[client].isWaitingForChatReason = false; PrepareBan(client, playerinfo[client].banTarget, playerinfo[client].banTime, sArgs);