From ab4f8e6ad3a2826e3cd9b32de6c68aae3ba0868b Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 10 Sep 2021 06:15:18 +0000 Subject: [PATCH] 1 --- server/gameserver/creature.cc | 2 +- server/gameserver/human.cc | 4 ++++ server/gameserver/player.cc | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/server/gameserver/creature.cc b/server/gameserver/creature.cc index ad61a21..5585b73 100644 --- a/server/gameserver/creature.cc +++ b/server/gameserver/creature.cc @@ -2826,7 +2826,7 @@ void Creature::FollowToTarget() #if 1 { #else - if (GetPos().ManhattanDistance(follow_target.Get()->GetPos()) > 50) { + if (GetPos().ManhattanDistance(follow_target.Get()->GetPos()) > 70) { #endif a8::Vec2 dir = a8::Vec2::UP; dir.Rotate(a8::RandAngle()); diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index b08fa61..5fe469a 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -3721,6 +3721,8 @@ void Human::DoFollow(int target_id) { Player* hum = (Player*)param.sender.GetUserData(); if (!hum->follow_target.Get()) { + hum->moving = false; + hum->moved_frames = 0; hum->room->xtimer.DeleteTimer(hum->room->xtimer.GetRunningTimer()); return; } @@ -3728,6 +3730,8 @@ void Human::DoFollow(int target_id) !(hum->follow_target.Get()->HasBuffEffect(kBET_Fly) || hum->follow_target.Get()->HasBuffEffect(kBET_Jump)) ){ + hum->moving = false; + hum->moved_frames = 0; hum->follow_target.Detach(); hum->room->xtimer.DeleteTimer(hum->room->xtimer.GetRunningTimer()); return; diff --git a/server/gameserver/player.cc b/server/gameserver/player.cc index b2c1ecc..d6c3af6 100644 --- a/server/gameserver/player.cc +++ b/server/gameserver/player.cc @@ -72,7 +72,9 @@ void Player::InternalUpdate(int delta_time) moving = true; moved_frames = 0; } - if (HasBuffEffect(kBET_Jump) && follow_target.Get()) { + if (HasBuffEffect(kBET_Jump) && + follow_target.Get() && + GetPos().ManhattanDistance(follow_target.Get()->GetPos()) > 70) { moving = true; moved_frames = 0; }