add the steamid to cpcache so segmented checkpoints don't keep starting in practice mode

This commit is contained in:
rtldg 2021-03-02 18:56:13 +00:00
parent a186e25b4e
commit 41f62f0a8f
2 changed files with 3 additions and 1 deletions

View File

@ -251,6 +251,7 @@ enum struct cp_cache_t
int iSerial;
bool bPractice;
int iGroundEntity;
int iSteamID;
}
#if defined USES_CHAT_COLORS

View File

@ -2439,6 +2439,7 @@ bool SaveCheckpoint(int client, int index, bool overflow = false)
cpcache.bSegmented = false;
}
cpcache.iSteamID = GetSteamAccountID(target);
cpcache.iSerial = GetClientSerial(target);
cpcache.bPractice = Shavit_IsPracticeMode(target);
@ -2597,7 +2598,7 @@ void TeleportToCheckpoint(int client, int index, bool suppressMessage)
((gI_CheckpointsSettings[client] & CP_ANGLES) > 0 || cpcache.bSegmented)? cpcache.fAngles:NULL_VECTOR,
vel);
if(cpcache.bPractice || !cpcache.bSegmented || GetClientSerial(client) != cpcache.iSerial)
if(cpcache.bPractice || !cpcache.bSegmented || (GetClientSerial(client) != cpcache.iSerial && GetSteamAccountID(client) != cpcache.iSteamID))
{
Shavit_SetPracticeMode(client, true, true);
}