Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 30 additions & 13 deletions addons/sourcemod/scripting/include/offstyledb_shavit.inc
Original file line number Diff line number Diff line change
Expand Up @@ -242,20 +242,37 @@ public void Shavit_AddAdditionalReplayPathsHere(int client, int style, float tim

public void Shavit_OnReplaySaved(int client, int style, float time, int jumps, int strafes, float sync, int track, float oldtime, float perfs, float avgvel, float maxvel, int timestamp, bool isbestreplay, bool istoolong, ArrayList replaypaths, ArrayList frames, int preframes, int postframes, const char[] name)
{
char replayPath[PLATFORM_MAX_PATH];
if (replaypaths != null && replaypaths.Length > 0)
{
replaypaths.GetString(0, replayPath, sizeof(replayPath));
}

// A non-canonical save (isbestreplay=false) is ours only if the path lives in
// our temp dir - other plugins may register their own extra replay paths too.
bool isOurCopy = !isbestreplay && replayPath[0] != '\0' && IsTempReplayPath(replayPath);
if(istoolong)
{
return;
}

if (!isbestreplay && !isOurCopy)
{
return;
}
char replayPath[PLATFORM_MAX_PATH];
// A non-canonical save (isbestreplay=false) is ours only if the path lives in
// our temp dir - other plugins may register their own extra replay paths too.
bool isOurCopy = false;

if(isbestreplay)
{
replaypaths.GetString(0, replayPath, sizeof(replayPath));
}
else
{
for(int i = 0; i < replaypaths.Length; i++)
{
replaypaths.GetString(i, replayPath, sizeof(replayPath));
if(IsTempReplayPath(replayPath))
{
isOurCopy = true;
break;
}
}

if(!isOurCopy)
{
return;
}
}

Records_HandleReplaySaved(client, isbestreplay, replayPath, isOurCopy);
}
Expand Down