This commit is contained in:
aozhiwei 2024-03-20 19:27:08 +08:00
parent 8196130498
commit 93d19816de

View File

@ -2641,6 +2641,9 @@ void Room::SendSMTeamFull(Human* hum)
void Room::OnTeamPartChg(Human* hum)
{
if (!IsMobaModeRoom()) {
return;
}
if (hpchg_human_hash_.empty()) {
hpchg_human_hash_[hum->GetUniId()] = hum;
xtimer.SetTimeoutWpEx
@ -2648,6 +2651,17 @@ void Room::OnTeamPartChg(Human* hum)
[this] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
cs::SMTeamPartNotify notify_msg;
for (auto& pair : hpchg_human_hash_) {
pair.second->FillMFTeamPart(notify_msg.add_members());
}
TraversePlayerList
(
[&notify_msg] (Player* hum) -> bool
{
hum->SendNotifyMsg(notify_msg);
return true;
});
hpchg_human_hash_.clear();
}
},