This commit is contained in:
Kyle Sanderson 2025-11-25 22:54:20 +08:00 committed by GitHub
commit 2864ff364a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1560,10 +1560,23 @@ int PlayerManager::InternalFilterCommandTarget(CPlayer *pAdmin, CPlayer *pTarget
if (pAdmin != NULL) if (pAdmin != NULL)
{ {
if ((flags & COMMAND_FILTER_NO_IMMUNITY) != COMMAND_FILTER_NO_IMMUNITY if ((flags & COMMAND_FILTER_NO_IMMUNITY) != COMMAND_FILTER_NO_IMMUNITY)
&& !adminsys->CanAdminTarget(pAdmin->GetAdminId(), pTarget->GetAdminId()))
{ {
return COMMAND_TARGET_IMMUNE; AdminId tid = pTarget->GetAdminId();
/* If the target is pre-auth they're targetable; bypassing immunity rules... */
if (tid == INVALID_ADMIN_ID && !pTarget->IsAuthStringValidated())
{
tid = adminsys->FindAdminByIdentity("steam", pTarget->GetAuthString(false));
if (tid == INVALID_ADMIN_ID)
{
tid = adminsys->FindAdminByIdentity("ip", pTarget->GetIPAddress());
}
}
if (!adminsys->CanAdminTarget(pAdmin->GetAdminId(), tid))
{
return COMMAND_TARGET_IMMUNE;
}
} }
} }