fix: Made breakup conditional (being host) (#1436)

Closes #1448
This commit is contained in:
DayibBaba
2023-06-17 15:49:48 +02:00
committed by GitHub
parent 4b73b46053
commit e5581a6f03
8 changed files with 79 additions and 13 deletions

View File

@ -36,17 +36,21 @@ namespace big
}
}
if (kick)
if (kick)
{
g_fiber_pool->queue_job([player] {
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("bailkick")))->call(player, {});
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("nfkick")))->call(player, {});
script::get_current()->yield(700ms);
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("breakup")))->call(player, {});
if(g_player_service->get_self()->is_host())
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("breakup")))->call(player, {}),
NETWORK::NETWORK_SESSION_KICK_PLAYER(player->id());
});
}
}
void reaction::process(player_ptr player)
{
if (!player->is_valid())