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);
|
||||
}
|
||||
if (owner_->GetPos().Distance2D2(out_point0) > 500) {
|
||||
int r = 0;
|
||||
for (auto& road : GetRoom()->GetMapMeta()->moba_path_points) {
|
||||
if (owner_->path_dir == 1) {
|
||||
for (auto& point : road) {
|
||||
if (std::get<0>(point)->pos.x < owner_->GetPos().GetX()) {
|
||||
for (auto itr = road.rbegin(); itr != road.rend(); ++itr) {
|
||||
auto& point = std::get<0>(*itr);
|
||||
if (point->pos.x < owner_->GetPos().GetX()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (auto& point : road) {
|
||||
if (std::get<0>(point)->pos.x > owner_->GetPos().GetX()) {
|
||||
for (auto itr = road.begin(); itr != road.end(); ++itr) {
|
||||
auto& point = std::get<0>(*itr);
|
||||
if (point->pos.x > owner_->GetPos().GetX()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
++r;
|
||||
}
|
||||
}
|
||||
return behaviac::BT_SUCCESS;
|
||||
|
Loading…
x
Reference in New Issue
Block a user