Use userid to find client when possible

Only fall back to authid lookup if userid no longer resolved to client index
This commit is contained in:
Rain 2023-10-15 20:49:37 +03:00
parent f9ec38103a
commit 5ac6be0497
No known key found for this signature in database
GPG Key ID: 83230CA2EA4B534E

View File

@ -67,7 +67,12 @@ void PrepareBan(int adminClient, int banTargetUserId, const char[] banTargetAuth
}
}
int target = GetClientOfAuthId(banTargetAuthId);
int target = (banTargetUserId == 0) ? 0 : GetClientOfUserId(banTargetUserId);
if (target == 0)
{
target = GetClientOfAuthId(banTargetAuthId);
}
// Ban & kick if target is connected, else record the ban with authid
if (target != 0)
{