diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 1916f9e..83a7168 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -3046,6 +3046,20 @@ void Human::ProcBuffEffect(Human* caster, Buff* buff) if (caster == this) { abort(); } + float target_distance = caster->GetPos().Distance(GetPos()); + if (target_distance <= 0.000001f) { + SetPos(caster->GetPos()); + target_pos = caster->GetPos(); + } else { + if (target_distance <= buff->meta->param3) { + SetPos(caster->GetPos()); + target_pos = caster->GetPos(); + } else { + move_dir = caster->GetPos() - GetPos(); + move_dir.Normalize(); + target_pos = GetPos() + move_dir * (target_distance - buff->meta->param3); + } + } } break; case kBET_JumpTo: @@ -3068,6 +3082,7 @@ void Human::ProcBuffEffect(Human* caster, Buff* buff) } } } + target_pos = skill_target_pos; } break; default: diff --git a/server/gameserver/human.h b/server/gameserver/human.h index a86d7b3..f44314f 100644 --- a/server/gameserver/human.h +++ b/server/gameserver/human.h @@ -149,6 +149,7 @@ class Human : public MoveableEntity xtimer_list* ad_timer_ = nullptr; Human* last_human_target = nullptr; + a8::Vec2 target_pos; int game_times = 0; int win_times = 0; int kill_times = 0;