From ca56e2ee3df82cbc2a7235f64a8e8dfdf61b3314 Mon Sep 17 00:00:00 2001 From: Phil25 Date: Sat, 2 Mar 2024 07:42:23 +0100 Subject: [PATCH] Fix `RTD2_Remove` backwards incompatibility (#105) --- scripting/rtd/natives.sp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripting/rtd/natives.sp b/scripting/rtd/natives.sp index 460e6ba..9ca98b9 100644 --- a/scripting/rtd/natives.sp +++ b/scripting/rtd/natives.sp @@ -305,13 +305,13 @@ public int Native_Remove(Handle hPlugin, int iParams) if (iReason == RTDRemove_Custom) GetNativeString(3, sReason, sizeof(sReason)); - if (!GetNativeCell(4)) // not forced + if (iParams >= 4 && !GetNativeCell(4)) // not forced { Perk perk = RemovePerk(client, iReason, sReason); return perk ? perk.Id : -1; } - int iInitiator = GetNativeCell(5); + int iInitiator = iParams >= 5 ? GetNativeCell(5) : 0; if (IsValidClient(iInitiator) && g_hRollers.GetInRoll(client) && GetForwardFunctionCount(g_hFwdCanRemove) > 0) { Call_StartForward(g_hFwdCanRemove);