This commit is contained in:
aozhiwei 2023-06-29 18:35:11 +08:00
parent 7654691f3d
commit f0d0d25998

View File

@ -457,8 +457,14 @@ behaviac::EBTStatus BaseAgent::CoShot()
current_target_.Get()->GetPos().ToGlmVec3())) {
return behaviac::BT_FAILURE;
}
bool shot_ok = false;
if (!GetOwner()->GetCurrWeapon()) {
return behaviac::BT_FAILURE;
}
glm::vec3 dir = GetOwner()->GetPos().CalcDir(current_target_.Get()->GetPos());
if (GlmHelper::Norm(dir) > 150) {
return behaviac::BT_FAILURE;
}
bool shot_ok = false;
GlmHelper::Normalize(dir);
GetOwner()->SetAttackDir(dir);
GetOwner()->shot_hold = true;