From f5652c641e7e7df8261b66a92dfcd0918303b99c Mon Sep 17 00:00:00 2001 From: rtldg <55846624+rtldg@users.noreply.github.com> Date: Mon, 29 Nov 2021 04:48:38 +0000 Subject: [PATCH] don't print practice mode warning when teleporting to practice mode checkpoint while already in practice mode --- addons/sourcemod/scripting/shavit-checkpoints.sp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/addons/sourcemod/scripting/shavit-checkpoints.sp b/addons/sourcemod/scripting/shavit-checkpoints.sp index 66903e49..b2128b10 100644 --- a/addons/sourcemod/scripting/shavit-checkpoints.sp +++ b/addons/sourcemod/scripting/shavit-checkpoints.sp @@ -1456,6 +1456,14 @@ void LoadCheckpointCache(int client, cp_cache_t cpcache, bool isPersistentData) return; } + if (cpcache.aSnapshot.bPracticeMode || !(cpcache.bSegmented || isPersistentData) || GetSteamAccountID(client) != cpcache.iSteamID) + { + cpcache.aSnapshot.bPracticeMode = true; + + // Do this here to trigger practice mode alert + Shavit_SetPracticeMode(client, true, true); + } + Shavit_LoadSnapshot(client, cpcache.aSnapshot); SetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue", cpcache.fSpeed); @@ -1469,14 +1477,8 @@ void LoadCheckpointCache(int client, cp_cache_t cpcache, bool isPersistentData) // Used to trigger all endtouch booster events which are then wiped via eventqueuefix :) MaybeDoPhysicsUntouch(client); - if (cpcache.aSnapshot.bPracticeMode || !(cpcache.bSegmented || isPersistentData) || GetSteamAccountID(client) != cpcache.iSteamID) + if (!cpcache.aSnapshot.bPracticeMode) { - Shavit_SetPracticeMode(client, true, true); - } - else - { - Shavit_SetPracticeMode(client, false, true); - if (gB_ReplayRecorder) { Shavit_HijackAngles(client, cpcache.fAngles[0], cpcache.fAngles[1], -1);