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
{
#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());

View File

@ -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;

View File

@ -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;
}