Only record snapshot of the currently active tee

Fixes #4636.
This commit is contained in:
heinrich5991 2022-01-26 01:28:20 +01:00
parent 590f29944c
commit aed195b244

View file

@ -2015,18 +2015,21 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket, int Conn, bool Dummy)
// add new
m_SnapshotStorage[Conn].Add(GameTick, time_get(), SnapSize, pTmpBuffer3, 1);
// for antiping: if the projectile netobjects from the server contains extra data, this is removed and the original content restored before recording demo
unsigned char aExtraInfoRemoved[CSnapshot::MAX_SIZE];
mem_copy(aExtraInfoRemoved, pTmpBuffer3, SnapSize);
SnapshotRemoveExtraProjectileInfo(aExtraInfoRemoved);
// add snapshot to demo
for(auto &DemoRecorder : m_DemoRecorder)
if(!Dummy)
{
if(DemoRecorder.IsRecording())
// for antiping: if the projectile netobjects from the server contains extra data, this is removed and the original content restored before recording demo
unsigned char aExtraInfoRemoved[CSnapshot::MAX_SIZE];
mem_copy(aExtraInfoRemoved, pTmpBuffer3, SnapSize);
SnapshotRemoveExtraProjectileInfo(aExtraInfoRemoved);
// add snapshot to demo
for(auto &DemoRecorder : m_DemoRecorder)
{
// write snapshot
DemoRecorder.RecordSnapshot(GameTick, aExtraInfoRemoved, SnapSize);
if(DemoRecorder.IsRecording())
{
// write snapshot
DemoRecorder.RecordSnapshot(GameTick, aExtraInfoRemoved, SnapSize);
}
}
}