This commit is contained in:
aozhiwei 2023-03-31 18:49:58 +08:00
parent e8879cde5a
commit ad54cdf366

View File

@ -658,7 +658,23 @@ void CallFuncBuff::SummonHeroSpecDistance()
int hero_id = meta->_int_buff_param2;
float distance = meta->GetBuffParam3(this);
if (!owner->dead || meta->dead_valid() != 0) {
glm::vec3 born_pos = owner->GetPos().ToGlmVec3();
bool hit_result;
glm::vec3 hit_point;
glm::vec3 start = owner->GetPos().ToGlmVec3();
glm::vec3 end = owner->GetPos().ToGlmVec3() + owner->GetAttackDir() * distance;
glm::vec3 born_pos = owner->GetPos().ToGlmVec3() + owner->GetAttackDir() * distance;
owner->room->map_instance->Scale(start);
owner->room->map_instance->Scale(end);
if (owner->room->map_instance->Raycast
(
start,
end,
hit_point,
hit_result
)) {
owner->room->map_instance->UnScale(hit_point);
born_pos = hit_point;
}
Hero* hero = owner->SummonHero(this,
born_pos,
owner->GetAttackDir());