This commit is contained in:
aozhiwei 2021-09-10 06:15:18 +00:00
parent 0e1e48363f
commit ab4f8e6ad3
3 changed files with 8 additions and 2 deletions

View File

@ -2826,7 +2826,7 @@ void Creature::FollowToTarget()
#if 1 #if 1
{ {
#else #else
if (GetPos().ManhattanDistance(follow_target.Get()->GetPos()) > 50) { if (GetPos().ManhattanDistance(follow_target.Get()->GetPos()) > 70) {
#endif #endif
a8::Vec2 dir = a8::Vec2::UP; a8::Vec2 dir = a8::Vec2::UP;
dir.Rotate(a8::RandAngle()); dir.Rotate(a8::RandAngle());

View File

@ -3721,6 +3721,8 @@ void Human::DoFollow(int target_id)
{ {
Player* hum = (Player*)param.sender.GetUserData(); Player* hum = (Player*)param.sender.GetUserData();
if (!hum->follow_target.Get()) { if (!hum->follow_target.Get()) {
hum->moving = false;
hum->moved_frames = 0;
hum->room->xtimer.DeleteTimer(hum->room->xtimer.GetRunningTimer()); hum->room->xtimer.DeleteTimer(hum->room->xtimer.GetRunningTimer());
return; return;
} }
@ -3728,6 +3730,8 @@ void Human::DoFollow(int target_id)
!(hum->follow_target.Get()->HasBuffEffect(kBET_Fly) || !(hum->follow_target.Get()->HasBuffEffect(kBET_Fly) ||
hum->follow_target.Get()->HasBuffEffect(kBET_Jump)) hum->follow_target.Get()->HasBuffEffect(kBET_Jump))
){ ){
hum->moving = false;
hum->moved_frames = 0;
hum->follow_target.Detach(); hum->follow_target.Detach();
hum->room->xtimer.DeleteTimer(hum->room->xtimer.GetRunningTimer()); hum->room->xtimer.DeleteTimer(hum->room->xtimer.GetRunningTimer());
return; return;

View File

@ -72,7 +72,9 @@ void Player::InternalUpdate(int delta_time)
moving = true; moving = true;
moved_frames = 0; 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; moving = true;
moved_frames = 0; moved_frames = 0;
} }