fix(MultiKick): Crash when calling CNetGamePlayer::is_host (#2106)

This commit is contained in:
Andreas Maerten 2023-09-09 11:32:55 +02:00 committed by GitHub
parent d1821dc2b8
commit 1a1c1b8e0a

View File

@ -25,7 +25,7 @@ namespace big
if (g_player_service->get_self()->is_host())
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("hostkick")))->call(player, {});
if (player && !player->is_host() && !g_player_service->get_self()->is_host())
if (player && !g_player_service->get_self()->is_host() && player->is_valid() && !player->is_host())
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("desync")))->call(player, {});
if (g_player_service->get_self()->is_host())