Fixed segmented CP exploit 2.

Thanks @cytrus224.
You could borrow others' CPs on segmented styles and use their route.
This commit is contained in:
shavit 2018-05-01 22:15:03 +03:00
parent 647701c28d
commit 66a2820808

View File

@ -52,6 +52,7 @@ enum CheckpointsCache
String:sCPTargetname[32],
ArrayList:aCPFrames,
bool:bCPSegmented,
bool:bCPSpectated,
PCPCACHE_SIZE
}
@ -1801,11 +1802,11 @@ bool SaveCheckpoint(int client, int index, bool overflow = false)
CopyArray(snapshot, cpcache[aCPSnapshot], TIMERSNAPSHOT_SIZE);
if(CanSegment(client))
if(CanSegment(target))
{
if(gB_Replay)
{
cpcache[aCPFrames] = Shavit_GetReplayData(client);
cpcache[aCPFrames] = Shavit_GetReplayData(target);
}
cpcache[bCPSegmented] = true;
@ -1817,6 +1818,8 @@ bool SaveCheckpoint(int client, int index, bool overflow = false)
cpcache[bCPSegmented] = false;
}
cpcache[bCPSpectated] = (client != target);
if(overflow)
{
int iMaxCPs = GetMaxCPs(client);
@ -1890,7 +1893,7 @@ void TeleportToCheckpoint(int client, int index, bool suppressMessage)
Shavit_StopTimer(client);
}
if(!cpcache[bCPSegmented])
if(!cpcache[bCPSegmented] || cpcache[bCPSpectated])
{
Shavit_SetPracticeMode(client, true, !bInStart);
}