1
This commit is contained in:
parent
c7f92ec486
commit
7e8a0b31bb
@ -280,16 +280,20 @@ behaviac::EBTStatus HeroAgent::DoAttack()
|
||||
target.Get()->GetPos().ToGlmVec3())) {
|
||||
return behaviac::BT_FAILURE;
|
||||
}
|
||||
bool shot_ok = false;
|
||||
glm::vec3 shot_dir = GetOwner()->GetPos().CalcDir(target.Get()->GetPos());;
|
||||
GlmHelper::Normalize(shot_dir);
|
||||
GetOwner()->SetAttackDir(shot_dir);
|
||||
if (bullet_trace_mode_) {
|
||||
GetOwner()->Shot(shot_dir, shot_ok, 0, target.Get()->GetUniId());
|
||||
} else {
|
||||
GetOwner()->Shot(shot_dir, shot_ok, 0, target.Get()->GetUniId());
|
||||
if (GetOwner()->dead) {
|
||||
return behaviac::BT_FAILURE;
|
||||
}
|
||||
if (GetOwner()->CanShot(true)) {
|
||||
bool shot_ok = false;
|
||||
glm::vec3 shot_dir = GetOwner()->GetPos().CalcDir(target.Get()->GetPos());;
|
||||
GlmHelper::Normalize(shot_dir);
|
||||
GetOwner()->SetAttackDir(shot_dir);
|
||||
if (bullet_trace_mode_) {
|
||||
GetOwner()->Shot(shot_dir, shot_ok, 0, target.Get()->GetUniId());
|
||||
} else {
|
||||
GetOwner()->Shot(shot_dir, shot_ok, 0, target.Get()->GetUniId());
|
||||
}
|
||||
}
|
||||
|
||||
return behaviac::BT_RUNNING;
|
||||
}
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user