fix: Prevent autokick of friends and trusted (#2989)

This commit is contained in:
R.K 2024-04-28 13:44:20 -07:00 committed by GitHub
parent fcf74bc198
commit ff55db8fa3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -12,6 +12,10 @@ namespace big
if (kick_host && !bLastKickHost) if (kick_host && !bLastKickHost)
{ {
g_player_service->iterate([](auto& plyr) { g_player_service->iterate([](auto& plyr) {
// Don't kick trusted players
if (plyr.second->is_trusted || (g.session.trust_friends && plyr.second->is_friend()))
return;
if (plyr.second->is_host()) if (plyr.second->is_host())
{ {
dynamic_cast<player_command*>(command::get("multikick"_J))->call(plyr.second, {}); dynamic_cast<player_command*>(command::get("multikick"_J))->call(plyr.second, {});