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 3385a0d7fb
commit 956d8110a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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