Skip to content

Commit

Permalink
Allow updating replay bot name without being a WR
Browse files Browse the repository at this point in the history
This allows editing the replay bot's name through the frame_cache_t of the replay data, which is useful for personal replays. Without this change, the replay bot's name after calling Shavit_StartReplayFromFrameCache would be the current WR's player name.
  • Loading branch information
BoomShotKapow authored May 28, 2024
1 parent 2805cd9 commit 654f9aa
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion addons/sourcemod/scripting/shavit-replay-playback.sp
Original file line number Diff line number Diff line change
Expand Up @@ -2132,7 +2132,16 @@ void FormatStyle(const char[] source, int style, bool central, int track, char d
else
{
FormatSeconds(GetReplayLength(style, track, aCache), sTime, 16);
GetReplayName(style, track, sName, sizeof(sName));

if(aCache.bNewFormat)
{
strcopy(sName, sizeof(sName), aCache.sReplayName);
}
else
{
GetReplayName(style, track, sName, sizeof(sName));
}

ReplaceString(temp, sizeof(temp), "{style}", gS_StyleStrings[style].sStyleName);
ReplaceString(temp, sizeof(temp), "{styletag}", gS_StyleStrings[style].sClanTag);
}
Expand Down

0 comments on commit 654f9aa

Please sign in to comment.