1
This commit is contained in:
parent
7654691f3d
commit
f0d0d25998
@ -457,8 +457,14 @@ behaviac::EBTStatus BaseAgent::CoShot()
|
|||||||
current_target_.Get()->GetPos().ToGlmVec3())) {
|
current_target_.Get()->GetPos().ToGlmVec3())) {
|
||||||
return behaviac::BT_FAILURE;
|
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());
|
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);
|
GlmHelper::Normalize(dir);
|
||||||
GetOwner()->SetAttackDir(dir);
|
GetOwner()->SetAttackDir(dir);
|
||||||
GetOwner()->shot_hold = true;
|
GetOwner()->shot_hold = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user