This commit is contained in:
aozhiwei 2022-12-28 15:15:16 +08:00
parent dce534711f
commit 9adb620d27

View File

@ -25,7 +25,6 @@ bool Movement::UpdatePosition()
} }
MovePathPoint& curr_point = paths_[path_index_]; MovePathPoint& curr_point = paths_[path_index_];
{ {
a8::Vec2 dir = a8::Vec2(curr_point.dir.x, curr_point.dir.z);
float h = 0.0f; float h = 0.0f;
if (owner_->room->map_instance->GetPosHeight(curr_point.curr_pos, h)) { if (owner_->room->map_instance->GetPosHeight(curr_point.curr_pos, h)) {
#ifdef DEBUG1 #ifdef DEBUG1
@ -41,7 +40,7 @@ bool Movement::UpdatePosition()
} else { } else {
//abort(); //abort();
} }
curr_point.curr_pos.AddVec2(dir * owner_->GetSpeed()); curr_point.curr_pos.AddGlmVec3(curr_point.dir * owner_->GetSpeed());
owner_->SetPos(curr_point.curr_pos); owner_->SetPos(curr_point.curr_pos);
if (owner_->room->map_instance->GetPosHeight(owner_->GetPos(), h)) { if (owner_->room->map_instance->GetPosHeight(owner_->GetPos(), h)) {
#ifdef DEBUG1 #ifdef DEBUG1