This commit is contained in:
aozhiwei 2023-11-01 10:40:58 +08:00
parent 16349f02a2
commit 86504cb104

View File

@ -1114,7 +1114,21 @@ behaviac::EBTStatus HeroAgent::CoGetNextMobaModeRoadPoint()
out_point0 += dir * (float)a8::RandEx(0, 100);
}
if (owner_->GetPos().Distance2D2(out_point0) > 500) {
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()) {
break;
}
}
} else {
for (auto& point : road) {
if (std::get<0>(point)->pos.x > owner_->GetPos().GetX()) {
break;
}
}
}
}
}
return behaviac::BT_SUCCESS;
}