From 654f9aa2392f7a2ee039083d0ca104fe96bcce4f Mon Sep 17 00:00:00 2001 From: BoomShot <75021396+BoomShotKapow@users.noreply.github.com> Date: Tue, 28 May 2024 00:07:04 -0400 Subject: [PATCH] Allow updating replay bot name without being a WR 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. --- addons/sourcemod/scripting/shavit-replay-playback.sp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/addons/sourcemod/scripting/shavit-replay-playback.sp b/addons/sourcemod/scripting/shavit-replay-playback.sp index 1ba59560..d25b4d74 100644 --- a/addons/sourcemod/scripting/shavit-replay-playback.sp +++ b/addons/sourcemod/scripting/shavit-replay-playback.sp @@ -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); }