From 9c0f17148810c8e086508b9aa4b5d28df306ca59 Mon Sep 17 00:00:00 2001 From: Obuss Date: Tue, 10 May 2016 16:34:17 -0500 Subject: [PATCH] Fixed errors in SprayManager FindTarget should just return 0 when it doesn't find someone tbh smh fam --- SprayManager/scripting/SprayManager.sp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/SprayManager/scripting/SprayManager.sp b/SprayManager/scripting/SprayManager.sp index a91cf658..b58d1473 100644 --- a/SprayManager/scripting/SprayManager.sp +++ b/SprayManager/scripting/SprayManager.sp @@ -5,7 +5,9 @@ #include #undef REQUIRE_PLUGIN + #include + #define REQUIRE_PLUGIN #pragma newdecls required @@ -1322,7 +1324,7 @@ public Action Command_SprayBan(int client, int argc) GetCmdArg(3, sReason, sizeof(sReason)); } - if (!(iTarget = FindTarget(client, sTarget))) + if ((iTarget = FindTarget(client, sTarget)) <= 0) return Plugin_Handled; if (SprayBanClient(client, iTarget, StringToInt(sLength), sReason)) @@ -1344,7 +1346,7 @@ public Action Command_SprayUnban(int client, int argc) GetCmdArg(1, sTarget, sizeof(sTarget)); - if (!(iTarget = FindTarget(client, sTarget))) + if ((iTarget = FindTarget(client, sTarget)) <= 0) return Plugin_Handled; if (!SprayUnbanClient(iTarget)) @@ -1371,7 +1373,7 @@ public Action Command_BanSpray(int client, int argc) GetCmdArg(1, sTarget, sizeof(sTarget)); - if (!(iTarget = FindTarget(client, sTarget))) + if ((iTarget = FindTarget(client, sTarget)) <= 0) return Plugin_Handled; if (!BanClientSpray(iTarget)) @@ -1398,7 +1400,7 @@ public Action Command_UnbanSpray(int client, int argc) GetCmdArg(1, sTarget, sizeof(sTarget)); - if (!(iTarget = FindTarget(client, sTarget))) + if ((iTarget = FindTarget(client, sTarget)) <= 0) return Plugin_Handled; if (!UnbanClientSpray(iTarget))