Skip to content

Commit

Permalink
hopefully the last commit for Shavit_SetCheckpoint (#1133)
Browse files Browse the repository at this point in the history
  • Loading branch information
rtldg committed Mar 19, 2022
1 parent 8f59007 commit ea9a962
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions addons/sourcemod/scripting/shavit-checkpoints.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1878,8 +1878,16 @@ public any Native_SetCheckpoint(Handle plugin, int numParams)
else
{
DeleteCheckpoint(client, position, true);
gA_Checkpoints[client].ShiftUp(position-1);
gA_Checkpoints[client].SetArray(position-1, cpcache);

if (gA_Checkpoints[client].Length >= position)
{
gA_Checkpoints[client].ShiftUp(position-1);
gA_Checkpoints[client].SetArray(position-1, cpcache);
}
else
{
gA_Checkpoints[client].PushArray(cpcache);
}
}

return true;
Expand Down

0 comments on commit ea9a962

Please sign in to comment.