1
This commit is contained in:
parent
86504cb104
commit
e6cc4105f1
@ -1114,20 +1114,24 @@ behaviac::EBTStatus HeroAgent::CoGetNextMobaModeRoadPoint()
|
|||||||
out_point0 += dir * (float)a8::RandEx(0, 100);
|
out_point0 += dir * (float)a8::RandEx(0, 100);
|
||||||
}
|
}
|
||||||
if (owner_->GetPos().Distance2D2(out_point0) > 500) {
|
if (owner_->GetPos().Distance2D2(out_point0) > 500) {
|
||||||
|
int r = 0;
|
||||||
for (auto& road : GetRoom()->GetMapMeta()->moba_path_points) {
|
for (auto& road : GetRoom()->GetMapMeta()->moba_path_points) {
|
||||||
if (owner_->path_dir == 1) {
|
if (owner_->path_dir == 1) {
|
||||||
for (auto& point : road) {
|
for (auto itr = road.rbegin(); itr != road.rend(); ++itr) {
|
||||||
if (std::get<0>(point)->pos.x < owner_->GetPos().GetX()) {
|
auto& point = std::get<0>(*itr);
|
||||||
|
if (point->pos.x < owner_->GetPos().GetX()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (auto& point : road) {
|
for (auto itr = road.begin(); itr != road.end(); ++itr) {
|
||||||
if (std::get<0>(point)->pos.x > owner_->GetPos().GetX()) {
|
auto& point = std::get<0>(*itr);
|
||||||
|
if (point->pos.x > owner_->GetPos().GetX()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
++r;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return behaviac::BT_SUCCESS;
|
return behaviac::BT_SUCCESS;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user