1
This commit is contained in:
parent
b79924129c
commit
7dd8e9c0ea
@ -96,7 +96,6 @@ void SprintBuff::CoCollisionCheck()
|
|||||||
|
|
||||||
void SprintBuff::Check(Position& pre_pos, std::map<int, long long>& hited_objects)
|
void SprintBuff::Check(Position& pre_pos, std::map<int, long long>& hited_objects)
|
||||||
{
|
{
|
||||||
pre_pos = owner->GetPos();
|
|
||||||
if (pre_pos.ManhattanDistance2D(owner->GetPos()) < 2) {
|
if (pre_pos.ManhattanDistance2D(owner->GetPos()) < 2) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -125,7 +124,7 @@ void SprintBuff::Check(Position& pre_pos, std::map<int, long long>& hited_object
|
|||||||
OnEnemyHit(enemy);
|
OnEnemyHit(enemy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
pre_pos = owner->GetPos();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SprintBuff::OnEnemyHit(Creature* enemy)
|
void SprintBuff::OnEnemyHit(Creature* enemy)
|
||||||
|
@ -16,7 +16,7 @@ float Position::Distance2D2(const Position& pos) const
|
|||||||
|
|
||||||
float Position::ManhattanDistance2D(const Position& target_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;
|
return distance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user