1
This commit is contained in:
parent
d49d2f67fc
commit
6aebffe95b
@ -3178,15 +3178,11 @@ void Creature::UpdateMove()
|
||||
{
|
||||
if (GetMovement()->UpdatePosition()) {
|
||||
} else {
|
||||
#if 0
|
||||
GetMovement()->CalcTargetPos(500);
|
||||
if (GetMovement()->GetMovePosition(out_pos)) {
|
||||
a8::Vec2 new_pos;
|
||||
new_pos.x = out_pos.x;
|
||||
new_pos.y = out_pos.z;
|
||||
//SetPos(new_pos);
|
||||
if (!GetMovement()->IsFindPath()) {
|
||||
GetMovement()->CalcTargetPos(100);
|
||||
if (GetMovement()->UpdatePosition()) {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
room->grid_service->MoveCreature(this);
|
||||
CheckSpecObject();
|
||||
|
@ -20,6 +20,7 @@ bool Movement::UpdatePosition()
|
||||
{
|
||||
if (path_index_ >= paths_.size()) {
|
||||
ClearPath();
|
||||
is_find_path_ = false;
|
||||
return false;
|
||||
}
|
||||
MovePathPoint& curr_point = paths_[path_index_];
|
||||
@ -269,6 +270,7 @@ void Movement::AddPaths(const a8::Vec3& start, std::vector<a8::Vec3>& paths)
|
||||
paths_.push_back(p);
|
||||
}
|
||||
#endif
|
||||
is_find_path_ = true;
|
||||
}
|
||||
|
||||
size_t Movement::GetPathSize()
|
||||
|
@ -23,9 +23,11 @@ class Movement
|
||||
void ClearPath();
|
||||
void AddPaths(const a8::Vec3& start, std::vector<a8::Vec3>& paths);
|
||||
size_t GetPathSize();
|
||||
bool IsFindPath() { return is_find_path_; }
|
||||
|
||||
private:
|
||||
std::vector<MovePathPoint> paths_;
|
||||
int path_index_ = 0;
|
||||
Creature* owner_ = nullptr;
|
||||
bool is_find_path_ = false;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user