This commit is contained in:
aozhiwei 2023-01-03 15:22:47 +08:00
parent b79924129c
commit 7dd8e9c0ea
2 changed files with 2 additions and 3 deletions

View File

@ -96,7 +96,6 @@ void SprintBuff::CoCollisionCheck()
void SprintBuff::Check(Position& pre_pos, std::map<int, long long>& hited_objects)
{
pre_pos = owner->GetPos();
if (pre_pos.ManhattanDistance2D(owner->GetPos()) < 2) {
return;
}
@ -125,7 +124,7 @@ void SprintBuff::Check(Position& pre_pos, std::map<int, long long>& hited_object
OnEnemyHit(enemy);
}
}
pre_pos = owner->GetPos();
}
void SprintBuff::OnEnemyHit(Creature* enemy)

View File

@ -16,7 +16,7 @@ float Position::Distance2D2(const Position& pos) const
float Position::ManhattanDistance2D(const Position& target_pos) const
{
float distance = std::fabs(x - target_pos.x) + std::fabs(z - target_pos.y);
float distance = std::fabs(x - target_pos.x) + std::fabs(z - target_pos.z);
return distance;
}