1
This commit is contained in:
parent
84bec528f5
commit
750a215bb2
@ -22,7 +22,12 @@ void SelectTargetWithSelfPosBuff::Activate()
|
||||
float distance = owner->GetPos().Distance2D2(c->GetPos());
|
||||
float angle = 0.0f;
|
||||
if (distance > 0.0001f) {
|
||||
angle = GlmHelper::CalcAngle(owner->GetAttackDir(),
|
||||
glm::vec3 dir = owner->GetAttackDir();
|
||||
if (GlmHelper::IsZero(dir)){
|
||||
dir = c->GetPos().ToGlmVec3() - owner->GetPos().ToGlmVec3();
|
||||
GlmHelper::Normalize(dir);
|
||||
}
|
||||
angle = GlmHelper::CalcAngle(dir,
|
||||
c->GetPos().ToGlmVec3() - owner->GetPos().ToGlmVec3());
|
||||
}
|
||||
if (distance < hold_param3_ && std::abs(angle) <= glm::radians(hold_param4_) / 2.0f / A8_PI) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user