Skip to content

Commit

Permalink
make CI happy
Browse files Browse the repository at this point in the history
  • Loading branch information
sjrc6 committed Dec 18, 2024
1 parent 6382bfc commit bfd2d66
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
7 changes: 7 additions & 0 deletions src/game/client/components/tclient/warlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,3 +355,10 @@ void CWarList::ConfigSaveCallback(IConfigManager *pConfigManager, void *pUserDat

return;
}

CWarList::~CWarList()
{
for(CWarType *WarType : m_WarTypes)
delete WarType;
m_WarTypes.clear();
}
2 changes: 2 additions & 0 deletions src/game/client/components/tclient/warlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ class CWarList : public CComponent
IOHANDLE m_WarlistFile;

public:
~CWarList();

// None type war entries will float to the top of the list, so they can be assigned a type
CWarType m_WarTypeNone = CWarType("none", ColorRGBA(1.0f, 1.0f, 1.0f, 1.0f), false);

Expand Down
15 changes: 4 additions & 11 deletions src/game/client/gameclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2506,12 +2506,6 @@ void CGameClient::OnPredict()
// TClient
// New antiping smoothing
CCharacter *pSmoothLocalChar = m_PredSmoothingWorld.GetCharacterById(m_Snap.m_LocalClientId);
if(!pSmoothLocalChar)
{
m_PredSmoothingWorld.CopyWorld(&m_PredictedWorld);
pSmoothLocalChar = m_PredSmoothingWorld.GetCharacterById(m_Snap.m_LocalClientId);
}

if(g_Config.m_ClAntiPingImproved &&
Predict() && AntiPingPlayers() &&
pSmoothLocalChar &&
Expand All @@ -2528,8 +2522,8 @@ void CGameClient::OnPredict()
pSmoothDummyChar = m_PredSmoothingWorld.GetCharacterById(m_PredictedDummyId);
pPredDummyChar = m_PredictedWorld.GetCharacterById(m_PredictedDummyId);
}
CNetObj_PlayerInput *pInputData = &m_PredictedWorld.GetCharacterById(m_Snap.m_LocalClientId)->LatestInput();
CNetObj_PlayerInput *pDummyInputData = !pPredDummyChar ? 0 : &m_PredictedWorld.GetCharacterById(m_PredictedDummyId)->LatestInput();
CNetObj_PlayerInput *pInputData = m_PredictedWorld.GetCharacterById(m_Snap.m_LocalClientId)->LatestInput();
CNetObj_PlayerInput *pDummyInputData = !pPredDummyChar ? 0 : m_PredictedWorld.GetCharacterById(m_PredictedDummyId)->LatestInput();
bool DummyFirst = pInputData && pDummyInputData && pSmoothDummyChar->GetCid() < pSmoothLocalChar->GetCid();
if(DummyFirst)
pSmoothDummyChar->OnDirectInput(pDummyInputData);
Expand Down Expand Up @@ -2567,9 +2561,8 @@ void CGameClient::OnPredict()
PrevGameTick = Client()->GameTick(g_Config.m_ClDummy) + (int)Client()->IntraGameTick(g_Config.m_ClDummy);

vec2 ServerPos = m_aClients[i].m_aPredPos[GameTick % 200];
vec2 PrevServerPos = m_aClients[i].m_aPredPos[(GameTick - 1) % 200];
// vec2 PrevServerPos = m_aClients[i].m_aPredPos[(GameTick - 1) % 200];

vec2 IntraServerPos = mix(PrevServerPos, ServerPos, Client()->IntraGameTick(g_Config.m_ClDummy));
vec2 PredDir = normalize(PredPos - ServerPos);
vec2 LastDir = normalize(PrevPredPos - ServerPos);

Expand Down Expand Up @@ -2611,7 +2604,6 @@ void CGameClient::OnPredict()

int HistoryCount = (PredStartTick - HistoryStartTick + 1);
HistoryVector = HistoryVector / HistoryCount;
float HistoryLength = length(HistoryVector);
HistoryVector = normalize(HistoryVector);
float Variance = 0.0f;
// Find the variance over the history window
Expand Down Expand Up @@ -2693,6 +2685,7 @@ void CGameClient::OnPredict()
}
}
// Copy the current pred world so on the next tick we have the "previous" pred world to advance and test against

if(m_NewPredictedTick)
m_PredSmoothingWorld.CopyWorld(&m_PredictedWorld);

Expand Down
2 changes: 1 addition & 1 deletion src/game/client/prediction/entities/character.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class CCharacter : public CEntity
int m_FreezeAccumulation;
int m_AliveAccumulation;
//TClient
CNetObj_PlayerInput LatestInput() { return m_LatestInput; };
CNetObj_PlayerInput* LatestInput() { return &m_LatestInput; };

private:
// weapon info
Expand Down

0 comments on commit bfd2d66

Please sign in to comment.