1
This commit is contained in:
parent
841fdde99e
commit
8e58095243
@ -278,10 +278,10 @@ bool TiledMap::CalcCurrPos(std::vector<int>& path_points, int old_pos_x, int old
|
|||||||
if (path_points.size() < 2) {
|
if (path_points.size() < 2) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
std::string path_point;
|
|
||||||
std::vector<std::string> stage_path_list;
|
std::vector<std::string> stage_path_list;
|
||||||
|
{
|
||||||
|
std::string path_point;
|
||||||
bool path_start = true;
|
bool path_start = true;
|
||||||
std::vector<GridCell*> grid_all_list;
|
|
||||||
for (auto& point : path_points) {
|
for (auto& point : path_points) {
|
||||||
if (path_start) {
|
if (path_start) {
|
||||||
path_point = a8::XValue(point).GetString();
|
path_point = a8::XValue(point).GetString();
|
||||||
@ -293,7 +293,9 @@ bool TiledMap::CalcCurrPos(std::vector<int>& path_points, int old_pos_x, int old
|
|||||||
path_point = point_str;
|
path_point = point_str;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
std::vector<GridCell*> grid_all_list;
|
||||||
|
{
|
||||||
bool exc_once = true;
|
bool exc_once = true;
|
||||||
for (auto& stage_path : stage_path_list) {
|
for (auto& stage_path : stage_path_list) {
|
||||||
std::vector<GridCell*>* grid_list = nullptr;
|
std::vector<GridCell*>* grid_list = nullptr;
|
||||||
@ -328,10 +330,12 @@ bool TiledMap::CalcCurrPos(std::vector<int>& path_points, int old_pos_x, int old
|
|||||||
grid_all_list.insert(grid_all_list.end(),grid_sort_list.begin()+1,grid_sort_list.end());
|
grid_all_list.insert(grid_all_list.end(),grid_sort_list.begin()+1,grid_sort_list.end());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (grid_all_list.empty()) {
|
if (grid_all_list.empty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
{
|
||||||
int grid_all_count = grid_all_list.size();
|
int grid_all_count = grid_all_list.size();
|
||||||
for (int i = 0; i < grid_all_count-1; ++i) {
|
for (int i = 0; i < grid_all_count-1; ++i) {
|
||||||
GridCell* gc_first = grid_all_list[i];
|
GridCell* gc_first = grid_all_list[i];
|
||||||
@ -355,6 +359,7 @@ bool TiledMap::CalcCurrPos(std::vector<int>& path_points, int old_pos_x, int old
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (time_ms > 0) {
|
if (time_ms > 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user