This commit is contained in:
aozhiwei 2024-01-19 15:53:50 +08:00
parent 0051d3f12b
commit baabbb4328

View File

@ -1448,6 +1448,14 @@ void CallFuncBuff::Shot()
if (bullet_meta) {
glm::vec3 target_pos = glm::vec3(x, y, z);
glm::vec3 attack_dir = target_pos - owner->GetPos().ToGlmVec3();
glm::vec3 old_attack_dir = owner->GetAttackDir();
float fly_distance = 0.0f;
if (GlmHelper::IsZero(attack_dir)) {
attack_dir = owner->GetAttackDir();
} else {
GlmHelper::Normalize(attack_dir);
}
owner->SetAttackDir(old_attack_dir);
}
}