Fix Linux build with C++20

src/game/client/components/chat.cpp: In lambda function:
src/game/client/components/chat.cpp:686:33: error: implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20 [-Werror=deprecated]
  686 |  auto &&FChatMsgCheckAndPrint = [=](CLine *pLine) {
      |                                 ^
src/game/client/components/chat.cpp:686:33: note: add explicit ‘this’ or ‘*this’ capture
This commit is contained in:
Dennis Felsing 2022-02-14 17:38:13 +01:00
parent 4c8e33ee8e
commit 1afd1a32d1
2 changed files with 2 additions and 2 deletions

View file

@ -683,7 +683,7 @@ void CChat::AddLine(int ClientID, int Team, const char *pLine)
if(*p == 0)
return;
auto &&FChatMsgCheckAndPrint = [=](CLine *pLine) {
auto &&FChatMsgCheckAndPrint = [this](CLine *pLine) {
if(pLine->m_ClientID < 0) // server or client message
{
if(Client()->State() != IClient::STATE_DEMOPLAYBACK)

View file

@ -1074,7 +1074,7 @@ void CGameClient::InvalidateSnapshot()
void CGameClient::OnNewSnapshot()
{
auto &&Evolve = [=](CNetObj_Character *pCharacter, int Tick) {
auto &&Evolve = [this](CNetObj_Character *pCharacter, int Tick) {
CWorldCore TempWorld;
CCharacterCore TempCore;
CTeamsCore TempTeams;