1
This commit is contained in:
parent
f913e68029
commit
602e10f7dc
@ -65,6 +65,7 @@ void CallFuncBuff::Activate()
|
|||||||
break;
|
break;
|
||||||
case BuffCallFunc_e::kFlashMove:
|
case BuffCallFunc_e::kFlashMove:
|
||||||
{
|
{
|
||||||
|
hold_param2_ = meta->GetBuffParam2(this);
|
||||||
ProcFlashMove();
|
ProcFlashMove();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -193,18 +194,25 @@ void CallFuncBuff::ProcFlashMove()
|
|||||||
{
|
{
|
||||||
float distance = owner->context_pos.Distance2D2(owner->GetPos());
|
float distance = owner->context_pos.Distance2D2(owner->GetPos());
|
||||||
if (distance > 0.00001f) {
|
if (distance > 0.00001f) {
|
||||||
glm::vec3 move_dir = owner->context_pos.CalcDir(owner->GetPos());
|
glm::vec3 move_dir = owner->GetPos().CalcDir(owner->context_pos);
|
||||||
|
GlmHelper::Normalize(move_dir);
|
||||||
float move_distance = std::min(distance, hold_param2_);
|
float move_distance = std::min(distance, hold_param2_);
|
||||||
glm::vec3 hit_point = glm::vec3(0.0f, 0.0f, 0.0f);
|
glm::vec3 hit_point = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||||
bool hit_result = false;
|
bool hit_result = false;
|
||||||
|
|
||||||
|
glm::vec3 start = owner->GetPos().ToGlmVec3();
|
||||||
|
glm::vec3 end = owner->GetPos().ToGlmVec3() + move_dir * move_distance;
|
||||||
|
owner->room->map_instance->Scale(start);
|
||||||
|
owner->room->map_instance->Scale(end);
|
||||||
|
|
||||||
bool ret = owner->room->map_instance->Raycast
|
bool ret = owner->room->map_instance->Raycast
|
||||||
(
|
(
|
||||||
owner->GetPos().ToGlmVec3(),
|
start,
|
||||||
move_dir * move_distance,
|
end,
|
||||||
hit_point,
|
hit_point,
|
||||||
hit_result);
|
hit_result);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
owner->room->map_instance->UnScale(hit_point);
|
||||||
owner->GetMovement()->ClearPath();
|
owner->GetMovement()->ClearPath();
|
||||||
owner->context_real_pos = hit_point;
|
owner->context_real_pos = hit_point;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user