diff --git a/server/gameserver/buff/callfunc.cc b/server/gameserver/buff/callfunc.cc index 78f7e0c8..24494b1f 100644 --- a/server/gameserver/buff/callfunc.cc +++ b/server/gameserver/buff/callfunc.cc @@ -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());