[Chat] Do what snake suggested in /master for lambdas (#442)

This commit is contained in:
Edo 2022-08-18 22:08:41 +02:00 committed by GitHub
parent 33cbd3f1c9
commit 2f6cbf4549
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -236,16 +236,12 @@ namespace Components
bool Chat::IsMuted(const Game::gentity_s* ent)
{
auto result = false;
const auto clientNum = ent->s.number;
const auto xuid = Game::svs_clients[clientNum].steamID;
MutedList.access([&](muteList& clients)
const auto result = MutedList.access<bool>([&](muteList& clients)
{
if (clients.contains(xuid))
{
result = true;
}
return clients.contains(xuid);
});
return result;