1
This commit is contained in:
parent
b37c85b2cd
commit
2995330ce9
@ -229,6 +229,12 @@ void CallFuncBuff::ProcFlashMove()
|
||||
|
||||
Position new_pos;
|
||||
new_pos.FromGlmVec3(hit_point);
|
||||
|
||||
glm::vec3 move_dir = hit_point - owner->GetPos().ToGlmVec3();
|
||||
GlmHelper::Normalize(move_dir);
|
||||
owner->SetMoveDir(move_dir);
|
||||
owner->SetAttackDir(move_dir);
|
||||
|
||||
Global::Instance()->verify_set_pos = 1;
|
||||
owner->SetPos(new_pos);
|
||||
Global::Instance()->verify_set_pos = 0;
|
||||
|
@ -9,6 +9,7 @@
|
||||
void FlashMoveBuff::Activate()
|
||||
{
|
||||
if (meta->_int_buff_param1 == 0) {
|
||||
owner->SetMoveDir(owner->skill_dir_);
|
||||
owner->SpecDirMove(owner->skill_dir_, std::max(owner->skill_distance_, 300.0f));
|
||||
}
|
||||
}
|
||||
|
@ -2930,7 +2930,7 @@ void Creature::ShortFindPath()
|
||||
bool ret = room->map_instance->Raycast(start, end, hit_point, hit_result);
|
||||
if (ret) {
|
||||
new_point = hit_point;
|
||||
room->map_instance->Scale(new_point);
|
||||
room->map_instance->UnScale(new_point);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@ -2941,7 +2941,7 @@ void Creature::ShortFindPath()
|
||||
int count = 0;
|
||||
|
||||
glm::vec3 start_pos = GetPos().ToGlmVec3() + GetMoveDir() * -1.0f * 2.0f;
|
||||
for (float angle = 30.0f; angle < 90.0f; angle += 30.0f) {
|
||||
for (float angle = 1.0f; angle < 90.0f; angle += 1.0f) {
|
||||
glm::vec3 move_dir = GetMoveDir();
|
||||
GlmHelper::RotateY(move_dir, angle);
|
||||
glm::vec3 end_pos = start_pos + move_dir * 80.0f;
|
||||
@ -2952,7 +2952,18 @@ void Creature::ShortFindPath()
|
||||
if (count <= 0) {
|
||||
last_pos = new_point;
|
||||
} else {
|
||||
float curr_distance = GlmHelper::Norm(new_point - start_pos);
|
||||
float curr_center_distance = GlmHelper::Norm(new_point - GetPos().ToGlmVec3());
|
||||
float last_distance = GlmHelper::Norm(last_pos - start_pos);
|
||||
float last_center_distance = GlmHelper::Norm(last_pos - GetPos().ToGlmVec3());
|
||||
if (curr_distance > last_distance) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
Global::Instance()->verify_set_pos = 1;
|
||||
GetMutablePos().FromGlmVec3(last_pos);
|
||||
Global::Instance()->verify_set_pos = 0;
|
||||
}
|
||||
++count;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user