This commit is contained in:
aozhiwei 2024-02-02 16:28:42 +08:00
parent a7423a63e9
commit 4912209451

View File

@ -2316,28 +2316,36 @@ void Room::NotifyGameStart()
for (auto& pair : accountid_hash_) {
pair.second->SendNotifyMsg(msg);
}
for (auto& pair : human_hash_) {
a8::SetBitFlag(pair.second->status, CS_DisableAttack);
}
TraverseHumanList
(
[] (Human* ele_hum) -> bool
{
a8::SetBitFlag(ele_hum->status, CS_DisableAttack);
return true;
});
xtimer.SetTimeoutEx
(mt::Param::GetIntParam("prepare_time", 3000) / FRAME_RATE_MS,
[this] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
for (auto& pair : human_hash_) {
a8::UnSetBitFlag(pair.second->status, CS_DisableAttack);
for (int buff_id : map_meta_->buff_list) {
const mt::Buff* buff_meta = mt::Buff::GetById(buff_id);
if (buff_meta) {
TraverseHumanList
(
[this] (Human* ele_hum) -> bool
{
a8::UnSetBitFlag(ele_hum->status, CS_DisableAttack);
for (int buff_id : map_meta_->buff_list) {
const mt::Buff* buff_meta = mt::Buff::GetById(buff_id);
if (buff_meta) {
#if 0
pair.second->AddBuff(pair.second,
buff_meta,
nullptr);
ele_hum->AddBuff(ele_hum,
buff_meta,
nullptr);
#endif
}
}
}
}
}
return true;
});
}
},
&xtimer_attacher_);