Skip to content

Commit

Permalink
Fix RTD2_Remove backwards incompatibility (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil25 committed Mar 2, 2024
1 parent a986983 commit ca56e2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripting/rtd/natives.sp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ca56e2e

Please sign in to comment.