1
This commit is contained in:
parent
b6aa0211aa
commit
16349f02a2
@ -1102,16 +1102,19 @@ behaviac::EBTStatus HeroAgent::CoGetNextMobaModeRoadPoint()
|
|||||||
GlmHelper::RotateY(dir, (10 + rand() % 360)/ 180.0f);
|
GlmHelper::RotateY(dir, (10 + rand() % 360)/ 180.0f);
|
||||||
GlmHelper::Normalize(dir);
|
GlmHelper::Normalize(dir);
|
||||||
if (owner_->point_idx < road.size()) {
|
if (owner_->point_idx < road.size()) {
|
||||||
if (owner_->path_dir == 1) {
|
|
||||||
out_point0 = std::get<0>(road.at(road.size() - owner_->point_idx - 1))->pos;
|
|
||||||
} else {
|
|
||||||
out_point0 = std::get<0>(road.at(owner_->point_idx))->pos;
|
|
||||||
out_point0 += dir * (float)a8::RandEx(0, 100);
|
|
||||||
}
|
|
||||||
++owner_->point_idx;
|
++owner_->point_idx;
|
||||||
} else {
|
} else {
|
||||||
owner_->point_idx = 0;
|
owner_->point_idx = 0;
|
||||||
owner_->path_dir = owner_->path_dir == 1 ? 0 : 1;
|
owner_->path_dir = owner_->path_dir == 1 ? 0 : 1;
|
||||||
|
}
|
||||||
|
if (owner_->path_dir == 1) {
|
||||||
|
out_point0 = std::get<0>(road.at(road.size() - owner_->point_idx - 1))->pos;
|
||||||
|
} else {
|
||||||
|
out_point0 = std::get<0>(road.at(owner_->point_idx))->pos;
|
||||||
|
out_point0 += dir * (float)a8::RandEx(0, 100);
|
||||||
|
}
|
||||||
|
if (owner_->GetPos().Distance2D2(out_point0) > 500) {
|
||||||
|
|
||||||
}
|
}
|
||||||
return behaviac::BT_SUCCESS;
|
return behaviac::BT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user