1
This commit is contained in:
parent
b4fd0bb29c
commit
03527680b0
@ -2701,8 +2701,8 @@ void Creature::UpdateMove()
|
|||||||
} else {
|
} else {
|
||||||
if (IsPlayer() || HasBuffEffect(kBET_Sprint)) {
|
if (IsPlayer() || HasBuffEffect(kBET_Sprint)) {
|
||||||
if (!GetMovement()->UpdatePosition()) {
|
if (!GetMovement()->UpdatePosition()) {
|
||||||
GetMovement()->CalcTargetPos(mt::Param::s().move_step_len);
|
|
||||||
if (HasBuffEffect(kBET_Sprint)) {
|
if (HasBuffEffect(kBET_Sprint)) {
|
||||||
|
GetMovement()->CalcTargetPos(mt::Param::s().move_step_len);
|
||||||
SprintBuff* buff = (SprintBuff*)GetBuffByEffectId(kBET_Sprint);
|
SprintBuff* buff = (SprintBuff*)GetBuffByEffectId(kBET_Sprint);
|
||||||
if (buff) {
|
if (buff) {
|
||||||
buff->SprintEnd();
|
buff->SprintEnd();
|
||||||
|
@ -402,7 +402,11 @@ bool Movement::MoveToPos(const glm::vec3& target_pos)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (GlmHelper::IsEqual2D(point.tar_pos.ToGlmVec3(), owner_->GetPos().ToGlmVec3())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
glm::vec3 dir = point.tar_pos.ToGlmVec3() - owner_->GetPos().ToGlmVec3();
|
glm::vec3 dir = point.tar_pos.ToGlmVec3() - owner_->GetPos().ToGlmVec3();
|
||||||
|
|
||||||
GlmHelper::Normalize(dir);
|
GlmHelper::Normalize(dir);
|
||||||
point.dir.x = dir.x;
|
point.dir.x = dir.x;
|
||||||
point.dir.y = dir.y;
|
point.dir.y = dir.y;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user