1
This commit is contained in:
parent
16349f02a2
commit
86504cb104
@ -1114,7 +1114,21 @@ 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) {
|
||||||
|
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;
|
return behaviac::BT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user