1
This commit is contained in:
parent
424752982e
commit
4966b2aa98
@ -135,7 +135,8 @@ void Movement::CalcTargetPos(float distance)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (point.distance < 0.00001f / owner_->room->GetMapMeta()->scale()) {
|
const float safe_distance = 2.0f;
|
||||||
|
if (point.distance < safe_distance + 1.0f / owner_->room->GetMapMeta()->scale()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,6 +145,8 @@ void Movement::CalcTargetPos(float distance)
|
|||||||
point.dir.x = dir.x;
|
point.dir.x = dir.x;
|
||||||
point.dir.y = dir.y;
|
point.dir.y = dir.y;
|
||||||
point.dir.z = dir.z;
|
point.dir.z = dir.z;
|
||||||
|
point.distance -= safe_distance;
|
||||||
|
point.tar_pos.FromGlmVec3(owner_->GetPos().ToGlmVec3() + point.dir * point.distance);
|
||||||
|
|
||||||
paths_.push_back(point);
|
paths_.push_back(point);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user