Some changes to navmesh path finding, disabled waypoint nav interface for now, might keep it disabled (i don't think anyones using it anyway) added a rule that might need some fine tuning for navmesh pathfinding

This commit is contained in:
KimLS
2018-12-24 14:48:11 -08:00
parent d3aa74ff54
commit e96539e6a8
10 changed files with 307 additions and 27 deletions
+16 -4
View File
@@ -785,15 +785,21 @@ void MobMovementManager::UpdatePath(Mob *who, float x, float y, float z, MobMove
void MobMovementManager::UpdatePathGround(Mob * who, float x, float y, float z, MobMovementMode mode)
{
PathfinderOptions opts;
opts.smooth_path = true;
opts.step_size = RuleR(Pathing, NavmeshStepSize);
opts.offset = who->GetZOffset();
opts.flags = PathingNotDisabled ^ PathingZoneLine;
//This is probably pointless since the nav mesh tool currently sets zonelines to disabled anyway
auto partial = false;
auto stuck = false;
auto route = zone->pathing->FindRoute(
auto route = zone->pathing->FindPath(
glm::vec3(who->GetX(), who->GetY(), who->GetZ()),
glm::vec3(x, y, z),
partial,
stuck,
PathingNotDisabled ^ PathingZoneLine);
opts);
auto eiter = _impl->Entries.find(who);
auto &ent = (*eiter);
@@ -864,14 +870,20 @@ void MobMovementManager::UpdatePathUnderwater(Mob *who, float x, float y, float
return;
}
PathfinderOptions opts;
opts.smooth_path = true;
opts.step_size = RuleR(Pathing, NavmeshStepSize);
opts.offset = who->GetZOffset();
opts.flags = PathingNotDisabled ^ PathingZoneLine;
auto partial = false;
auto stuck = false;
auto route = zone->pathing->FindRoute(
auto route = zone->pathing->FindPath(
glm::vec3(who->GetX(), who->GetY(), who->GetZ()),
glm::vec3(x, y, z),
partial,
stuck,
PathingNotDisabled ^ PathingZoneLine);
opts);
if (route.size() == 0) {
HandleStuckBehavior(who, x, y, z, mode);