This commit is contained in:
aozhiwei 2023-11-07 11:26:37 +08:00
parent e68ec41ac8
commit 8e974d5de9

View File

@ -1071,7 +1071,7 @@ void CallFuncBuff::RangeHoldBuff()
}
}
};
owner->room->xtimer.SetIntervalWpEx
auto check_timer = owner->room->xtimer.SetIntervalWpEx
(
SERVER_FRAME_RATE,
[this, context, on_enter, on_stay, on_leave, check_cb]
@ -1086,8 +1086,9 @@ void CallFuncBuff::RangeHoldBuff()
event_handlers_.push_back(owner->GetTrigger()->AddListener
(
kDieEvent,
[this, context] (const a8::Args& args) mutable
[this, context, check_timer] (const a8::Args& args) mutable
{
owner->room->xtimer.Delete(check_timer);
for (auto& pair : context->in_human_infos) {
for (int buff_uniid : pair.second.buff_uniids) {
if (pair.second.c.Get()) {
@ -1095,6 +1096,7 @@ void CallFuncBuff::RangeHoldBuff()
}
}
}
context->in_human_infos.clear();
}
));
}