Finally fixed bugs, now need to do cleanup

This commit is contained in:
Vladislav Khorev committed 2026-01-17 20:06:57 +03:00
1 parent 64385ba15c
commit 579f4886d1
3 files changed
+91 -102

No files matched your search

+22 -2
View File
@@ -166,7 +166,19 @@ namespace ZL {
{
std::lock_guard<std::mutex> pLock(playersMutex);
auto& rp = remotePlayers[remoteId];
rp.timedRemoteStates.push_back(remoteState);
if (rp.timedRemoteStates.size() > 0 && rp.timedRemoteStates[rp.timedRemoteStates.size() - 1].lastUpdateServerTime == remoteState.lastUpdateServerTime)
{
rp.timedRemoteStates[rp.timedRemoteStates.size() - 1] = remoteState;
}
else
{
rp.timedRemoteStates.push_back(remoteState);
}
//rp.timedRemoteStates.push_back(remoteState);
auto cutoff_time = nowTime - std::chrono::milliseconds(CUTOFF_TIME);
@@ -304,7 +316,15 @@ namespace ZL {
remoteState.lastUpdateServerTime = uptime_timepoint;
auto& rp = remotePlayers[id];
rp.timedRemoteStates.push_back(remoteState);
if (rp.timedRemoteStates.size() > 0 && rp.timedRemoteStates[rp.timedRemoteStates.size() - 1].lastUpdateServerTime == remoteState.lastUpdateServerTime)
{
rp.timedRemoteStates[rp.timedRemoteStates.size() - 1] = remoteState;
}
else
{
rp.timedRemoteStates.push_back(remoteState);
}
auto cutoff_time = now_ms - std::chrono::milliseconds(CUTOFF_TIME);