CheatDetection: Move player access (#1209)

This commit is contained in:
David Markowitz 2023-10-05 15:31:05 -07:00 committed by GitHub
parent a8820c14f2
commit 258ee5c1ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,17 +55,18 @@ void LogAndSaveFailedAntiCheatCheck(const LWOOBJID& id, const SystemAddress& sys
player->GetCharacter()->GetName().c_str(), player->GetObjectID(),
sysAddr.ToString(),
entity->GetCharacter()->GetName().c_str(), entity->GetObjectID());
toReport = player->GetParentUser();
// In the case that the target entity id did not exist, just log the player info.
} else if (player) {
Game::logger->Log("CheatDetection", "Player (%s) (%llu) at system address (%s) with sending player (%llu) does not match their own.",
player->GetCharacter()->GetName().c_str(), player->GetObjectID(),
sysAddr.ToString(), id);
toReport = player->GetParentUser();
// In the rare case that the player does not exist, just log the system address and who the target id was.
} else {
Game::logger->Log("CheatDetection", "Player at system address (%s) with sending player (%llu) does not match their own.",
sysAddr.ToString(), id);
}
toReport = player->GetParentUser();
break;
}
case CheckType::User: {