This commit is contained in:
aozhiwei 2024-01-19 19:17:23 +08:00
parent d25eeeee61
commit 6432a4c81c

View File

@ -1459,11 +1459,24 @@ void CallFuncBuff::Shot()
}
CreatureWeakPtr owner_wp = owner->GetWeakPtrRef();
int buff_uniid_copy = buff_uniid;
auto meta_copy = meta;
auto on_bullet_exit =
[owner_wp, buff_uniid_copy] (Bullet* bullet) mutable
[owner_wp, buff_uniid_copy, meta_copy] (Bullet* bullet) mutable
{
if (owner_wp.Get()) {
std::shared_ptr<std::vector<float>> vars = std::make_shared<std::vector<float>>();
vars->push_back(bullet->GetPos().GetX());
vars->push_back(bullet->GetPos().GetY());
vars->push_back(bullet->GetPos().GetZ());
for (int buff_id : meta_copy->_buff_param7_int_list) {
owner_wp.Get()->TryAddBuff(
owner_wp.Get(),
buff_id,
bullet->skill_meta,
nullptr,
vars
);
}
}
};
glm::vec3 old_attack_dir = owner->GetAttackDir();